diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 672dd424d..79891553f 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -25,15 +25,20 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Install Go - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: - go-version: 1.24.x + go-version: 1.25.x - name: Install snmp_exporter/generator dependencies run: sudo apt-get update && sudo apt-get -y install libsnmp-dev if: github.repository == 'prometheus/snmp_exporter' + - name: Get golangci-lint version + id: golangci-lint-version + run: echo "version=$(make print-golangci-lint-version)" >> $GITHUB_OUTPUT - name: Lint - uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0 + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 with: args: --verbose - version: v2.1.5 + version: ${{ steps.golangci-lint-version.outputs.version }} diff --git a/.golangci.yml b/.golangci.yml index 1867f739c..ea1ad2f5c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -19,6 +19,10 @@ linters: capital: true misspell: locale: US + revive: + rules: + - name: var-naming + disabled: true exclusions: presets: - comments diff --git a/Makefile.common b/Makefile.common index 6f61bec48..6762d0f83 100644 --- a/Makefile.common +++ b/Makefile.common @@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_ SKIP_GOLANGCI_LINT := GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v2.1.5 +GOLANGCI_LINT_VERSION ?= v2.4.0 GOLANGCI_FMT_OPTS ?= # golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64. # windows isn't included here because of the path separator being different. @@ -266,6 +266,10 @@ $(GOLANGCI_LINT): | sh -s -- -b $(FIRST_GOPATH)/bin $(GOLANGCI_LINT_VERSION) endif +.PHONY: common-print-golangci-lint-version +common-print-golangci-lint-version: + @echo $(GOLANGCI_LINT_VERSION) + .PHONY: precheck precheck:: diff --git a/cmdline_test.go b/cmdline_test.go index 4eb433f84..f5b6a5eb6 100644 --- a/cmdline_test.go +++ b/cmdline_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package procfs diff --git a/cpuinfo.go b/cpuinfo.go index f0950bb49..25bc1f429 100644 --- a/cpuinfo.go +++ b/cpuinfo.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package procfs diff --git a/cpuinfo_armx.go b/cpuinfo_armx.go index 64cfd534c..4828647f3 100644 --- a/cpuinfo_armx.go +++ b/cpuinfo_armx.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (arm || arm64) -// +build linux -// +build arm arm64 package procfs diff --git a/cpuinfo_loong64.go b/cpuinfo_loong64.go index d88442f0e..c752f002f 100644 --- a/cpuinfo_loong64.go +++ b/cpuinfo_loong64.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package procfs diff --git a/cpuinfo_mipsx.go b/cpuinfo_mipsx.go index c11207f3a..bc4fc19ad 100644 --- a/cpuinfo_mipsx.go +++ b/cpuinfo_mipsx.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (mips || mipsle || mips64 || mips64le) -// +build linux -// +build mips mipsle mips64 mips64le package procfs diff --git a/cpuinfo_others.go b/cpuinfo_others.go index a6b2b3127..dcc1b8f96 100644 --- a/cpuinfo_others.go +++ b/cpuinfo_others.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux && !386 && !amd64 && !arm && !arm64 && !loong64 && !mips && !mips64 && !mips64le && !mipsle && !ppc64 && !ppc64le && !riscv64 && !s390x -// +build linux,!386,!amd64,!arm,!arm64,!loong64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x package procfs diff --git a/cpuinfo_ppcx.go b/cpuinfo_ppcx.go index 003bc2ad4..1994600f1 100644 --- a/cpuinfo_ppcx.go +++ b/cpuinfo_ppcx.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (ppc64 || ppc64le) -// +build linux -// +build ppc64 ppc64le package procfs diff --git a/cpuinfo_riscvx.go b/cpuinfo_riscvx.go index 1c9b7313b..7ddd91b91 100644 --- a/cpuinfo_riscvx.go +++ b/cpuinfo_riscvx.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (riscv || riscv64) -// +build linux -// +build riscv riscv64 package procfs diff --git a/cpuinfo_s390x.go b/cpuinfo_s390x.go index fa3686bc0..650cd44cc 100644 --- a/cpuinfo_s390x.go +++ b/cpuinfo_s390x.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package procfs diff --git a/cpuinfo_test.go b/cpuinfo_test.go index 3699f4c6b..8af544a01 100644 --- a/cpuinfo_test.go +++ b/cpuinfo_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package procfs diff --git a/cpuinfo_x86.go b/cpuinfo_x86.go index a0ef55562..ac2ae34af 100644 --- a/cpuinfo_x86.go +++ b/cpuinfo_x86.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (386 || amd64) -// +build linux -// +build 386 amd64 package procfs diff --git a/fs_statfs_notype.go b/fs_statfs_notype.go index 1b5bdbdf8..9f4ad4056 100644 --- a/fs_statfs_notype.go +++ b/fs_statfs_notype.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !freebsd && !linux -// +build !freebsd,!linux package procfs diff --git a/fs_statfs_type.go b/fs_statfs_type.go index 80df79c31..4243ec97c 100644 --- a/fs_statfs_type.go +++ b/fs_statfs_type.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build freebsd || linux -// +build freebsd linux package procfs diff --git a/internal/util/sysreadfile.go b/internal/util/sysreadfile.go index d5404a6d7..b6dccef9a 100644 --- a/internal/util/sysreadfile.go +++ b/internal/util/sysreadfile.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build (linux || darwin) && !appengine -// +build linux darwin -// +build !appengine package util diff --git a/internal/util/sysreadfile_compat.go b/internal/util/sysreadfile_compat.go index 1d86f5e63..840f0e5e2 100644 --- a/internal/util/sysreadfile_compat.go +++ b/internal/util/sysreadfile_compat.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build (linux && appengine) || (!linux && !darwin) -// +build linux,appengine !linux,!darwin package util diff --git a/kernel_hung.go b/kernel_hung.go index 9b13cc29d..ea3759adf 100644 --- a/kernel_hung.go +++ b/kernel_hung.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/kernel_hung_test.go b/kernel_hung_test.go index 569f13e3d..d81f2d7d0 100644 --- a/kernel_hung_test.go +++ b/kernel_hung_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/kernel_random.go b/kernel_random.go index db88566bd..c069dc389 100644 --- a/kernel_random.go +++ b/kernel_random.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/kernel_random_test.go b/kernel_random_test.go index 836a88d2f..c168a0fa0 100644 --- a/kernel_random_test.go +++ b/kernel_random_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/proc_maps.go b/proc_maps.go index 7e75c286b..ec22016e6 100644 --- a/proc_maps.go +++ b/proc_maps.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && !js -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris -// +build !js package procfs diff --git a/proc_maps32_test.go b/proc_maps32_test.go index 77444c4c5..4f32d3be1 100644 --- a/proc_maps32_test.go +++ b/proc_maps32_test.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && (386 || arm || mips || mipsle) -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris -// +build 386 arm mips mipsle package procfs diff --git a/proc_maps64_test.go b/proc_maps64_test.go index 44ec68c46..94d347c81 100644 --- a/proc_maps64_test.go +++ b/proc_maps64_test.go @@ -12,11 +12,6 @@ // limitations under the License. //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && !386 && !arm && !mips && !mipsle -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris -// +build !386 -// +build !arm -// +build !mips -// +build !mipsle package procfs diff --git a/proc_smaps.go b/proc_smaps.go index 9a297afcf..892b0f4f5 100644 --- a/proc_smaps.go +++ b/proc_smaps.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/proc_smaps_test.go b/proc_smaps_test.go index b11b98fe7..c005b1a4d 100644 --- a/proc_smaps_test.go +++ b/proc_smaps_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/scripts/check_build_tags.sh b/scripts/check_build_tags.sh index 104769bf1..d3b75c8df 100755 --- a/scripts/check_build_tags.sh +++ b/scripts/check_build_tags.sh @@ -2,7 +2,7 @@ fail=0 while read -r f ; do - if ! grep -q '+build linux' "$f" ; then + if ! grep -q '//go:build linux' "$f" ; then echo "missing linux build tag: $f" fail=1 fi diff --git a/selinuxfs/avc_cache_stats.go b/selinuxfs/avc_cache_stats.go index 0c37e0f07..dc90ff4ac 100644 --- a/selinuxfs/avc_cache_stats.go +++ b/selinuxfs/avc_cache_stats.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux && !noselinux -// +build linux,!noselinux package selinuxfs diff --git a/selinuxfs/avc_cache_stats_test.go b/selinuxfs/avc_cache_stats_test.go index 62560884e..80ea05f68 100644 --- a/selinuxfs/avc_cache_stats_test.go +++ b/selinuxfs/avc_cache_stats_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux && !noselinux -// +build linux,!noselinux package selinuxfs diff --git a/selinuxfs/avc_hash_stats.go b/selinuxfs/avc_hash_stats.go index 1d01755fd..0f4903dbc 100644 --- a/selinuxfs/avc_hash_stats.go +++ b/selinuxfs/avc_hash_stats.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux && !noselinux -// +build linux,!noselinux package selinuxfs diff --git a/selinuxfs/avc_hash_stats_test.go b/selinuxfs/avc_hash_stats_test.go index 46dd59c83..9e6f48bba 100644 --- a/selinuxfs/avc_hash_stats_test.go +++ b/selinuxfs/avc_hash_stats_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux && !noselinux -// +build linux,!noselinux package selinuxfs diff --git a/selinuxfs/fs.go b/selinuxfs/fs.go index f3c713721..a5091d42f 100644 --- a/selinuxfs/fs.go +++ b/selinuxfs/fs.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux && !noselinux -// +build linux,!noselinux package selinuxfs diff --git a/selinuxfs/fs_test.go b/selinuxfs/fs_test.go index 64b60f63d..28523c562 100644 --- a/selinuxfs/fs_test.go +++ b/selinuxfs/fs_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux && !noselinux -// +build linux,!noselinux package selinuxfs diff --git a/sysfs/class_cooling_device.go b/sysfs/class_cooling_device.go index 4bf1d273e..a862b9140 100644 --- a/sysfs/class_cooling_device.go +++ b/sysfs/class_cooling_device.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_cooling_device_test.go b/sysfs/class_cooling_device_test.go index 0c7c497c1..b0e3b361d 100644 --- a/sysfs/class_cooling_device_test.go +++ b/sysfs/class_cooling_device_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_dmi.go b/sysfs/class_dmi.go index 35f8d1f39..cb6f9e069 100644 --- a/sysfs/class_dmi.go +++ b/sysfs/class_dmi.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_dmi_test.go b/sysfs/class_dmi_test.go index a149ef417..285a63ebb 100644 --- a/sysfs/class_dmi_test.go +++ b/sysfs/class_dmi_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_drm.go b/sysfs/class_drm.go index b221e688b..36a1e1112 100644 --- a/sysfs/class_drm.go +++ b/sysfs/class_drm.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_drm_amdgpu.go b/sysfs/class_drm_amdgpu.go index 51b50d0f7..2611822cc 100644 --- a/sysfs/class_drm_amdgpu.go +++ b/sysfs/class_drm_amdgpu.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_drm_amdgpu_test.go b/sysfs/class_drm_amdgpu_test.go index 356204012..099afd087 100644 --- a/sysfs/class_drm_amdgpu_test.go +++ b/sysfs/class_drm_amdgpu_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_drm_card.go b/sysfs/class_drm_card.go index 8f0baeba2..586282a23 100644 --- a/sysfs/class_drm_card.go +++ b/sysfs/class_drm_card.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_drm_card_test.go b/sysfs/class_drm_card_test.go index 4d0646738..f10763121 100644 --- a/sysfs/class_drm_card_test.go +++ b/sysfs/class_drm_card_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_fibrechannel.go b/sysfs/class_fibrechannel.go index 4b583f71f..91cb2629e 100644 --- a/sysfs/class_fibrechannel.go +++ b/sysfs/class_fibrechannel.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_fibrechannel_test.go b/sysfs/class_fibrechannel_test.go index 5f1869ecd..80bec857e 100644 --- a/sysfs/class_fibrechannel_test.go +++ b/sysfs/class_fibrechannel_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_infiniband.go b/sysfs/class_infiniband.go index 3cd1095ee..c931ae851 100644 --- a/sysfs/class_infiniband.go +++ b/sysfs/class_infiniband.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_infiniband_test.go b/sysfs/class_infiniband_test.go index c61e8bfbb..471a271e8 100644 --- a/sysfs/class_infiniband_test.go +++ b/sysfs/class_infiniband_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_nvme.go b/sysfs/class_nvme.go index 439847a58..166bf580c 100644 --- a/sysfs/class_nvme.go +++ b/sysfs/class_nvme.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_nvme_test.go b/sysfs/class_nvme_test.go index 9827474c7..9e8b9b2c8 100644 --- a/sysfs/class_nvme_test.go +++ b/sysfs/class_nvme_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_power_supply.go b/sysfs/class_power_supply.go index cb1a25169..e69135b4d 100644 --- a/sysfs/class_power_supply.go +++ b/sysfs/class_power_supply.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_power_supply_test.go b/sysfs/class_power_supply_test.go index 52641497c..c50119171 100644 --- a/sysfs/class_power_supply_test.go +++ b/sysfs/class_power_supply_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_powercap.go b/sysfs/class_powercap.go index 256cee4ae..d1e701e01 100644 --- a/sysfs/class_powercap.go +++ b/sysfs/class_powercap.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_powercap_test.go b/sysfs/class_powercap_test.go index 4122a9dcf..341121862 100644 --- a/sysfs/class_powercap_test.go +++ b/sysfs/class_powercap_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_sas_device.go b/sysfs/class_sas_device.go index 644cdc08c..d762475a7 100644 --- a/sysfs/class_sas_device.go +++ b/sysfs/class_sas_device.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_sas_device_test.go b/sysfs/class_sas_device_test.go index 0128306e1..bf60e6c1d 100644 --- a/sysfs/class_sas_device_test.go +++ b/sysfs/class_sas_device_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_sas_host.go b/sysfs/class_sas_host.go index fade1ca64..6aba7962b 100644 --- a/sysfs/class_sas_host.go +++ b/sysfs/class_sas_host.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_sas_host_test.go b/sysfs/class_sas_host_test.go index 8d6e067f3..a4fc2cb31 100644 --- a/sysfs/class_sas_host_test.go +++ b/sysfs/class_sas_host_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_sas_phy.go b/sysfs/class_sas_phy.go index 67bd7a68a..557c8c216 100644 --- a/sysfs/class_sas_phy.go +++ b/sysfs/class_sas_phy.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_sas_phy_test.go b/sysfs/class_sas_phy_test.go index f586fb4cd..01560dcc2 100644 --- a/sysfs/class_sas_phy_test.go +++ b/sysfs/class_sas_phy_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_sas_port.go b/sysfs/class_sas_port.go index 7afe251c7..07e665f1a 100644 --- a/sysfs/class_sas_port.go +++ b/sysfs/class_sas_port.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_sas_port_test.go b/sysfs/class_sas_port_test.go index 56668b1fe..0e602c323 100644 --- a/sysfs/class_sas_port_test.go +++ b/sysfs/class_sas_port_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_scsitape.go b/sysfs/class_scsitape.go index 7355d64a8..606e8943e 100644 --- a/sysfs/class_scsitape.go +++ b/sysfs/class_scsitape.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_scsitape_test.go b/sysfs/class_scsitape_test.go index 1ab81b135..e6f214fba 100644 --- a/sysfs/class_scsitape_test.go +++ b/sysfs/class_scsitape_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_thermal.go b/sysfs/class_thermal.go index 19706c0b1..a25a5c4a0 100644 --- a/sysfs/class_thermal.go +++ b/sysfs/class_thermal.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_thermal_test.go b/sysfs/class_thermal_test.go index 7d54fb11d..55ee1fecb 100644 --- a/sysfs/class_thermal_test.go +++ b/sysfs/class_thermal_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_watchdog.go b/sysfs/class_watchdog.go index bcc2a67f4..6e9c5cf39 100644 --- a/sysfs/class_watchdog.go +++ b/sysfs/class_watchdog.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/class_watchdog_test.go b/sysfs/class_watchdog_test.go index ad9d63a8d..51a8f84b1 100644 --- a/sysfs/class_watchdog_test.go +++ b/sysfs/class_watchdog_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/clocksource.go b/sysfs/clocksource.go index bb3a84211..cc4c4d462 100644 --- a/sysfs/clocksource.go +++ b/sysfs/clocksource.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/clocksource_test.go b/sysfs/clocksource_test.go index d2ebc90b2..c9053dd12 100644 --- a/sysfs/clocksource_test.go +++ b/sysfs/clocksource_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/doc.go b/sysfs/doc.go index dc963446b..cead1ab87 100644 --- a/sysfs/doc.go +++ b/sysfs/doc.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux // Package sysfs provides functions to retrieve system and kernel metrics // from the pseudo-filesystem sys. diff --git a/sysfs/fs.go b/sysfs/fs.go index b8ee21d71..2b3e5c000 100644 --- a/sysfs/fs.go +++ b/sysfs/fs.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/fs_test.go b/sysfs/fs_test.go index ee4e147d2..e03424a72 100644 --- a/sysfs/fs_test.go +++ b/sysfs/fs_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/mdraid.go b/sysfs/mdraid.go index ab9fb26d9..d17e5786a 100644 --- a/sysfs/mdraid.go +++ b/sysfs/mdraid.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/mdraid_test.go b/sysfs/mdraid_test.go index 4cf279fe2..14f29dc26 100644 --- a/sysfs/mdraid_test.go +++ b/sysfs/mdraid_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/net_class.go b/sysfs/net_class.go index 20a06122d..c2b6d7c17 100644 --- a/sysfs/net_class.go +++ b/sysfs/net_class.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/net_class_aer.go b/sysfs/net_class_aer.go index 84ff56f7d..cc9e0a680 100644 --- a/sysfs/net_class_aer.go +++ b/sysfs/net_class_aer.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/net_class_aer_test.go b/sysfs/net_class_aer_test.go index 2d75265a7..e7d7c9f06 100644 --- a/sysfs/net_class_aer_test.go +++ b/sysfs/net_class_aer_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/net_class_ecn.go b/sysfs/net_class_ecn.go index 51d93e73c..3c8d7568d 100644 --- a/sysfs/net_class_ecn.go +++ b/sysfs/net_class_ecn.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/net_class_ecn_test.go b/sysfs/net_class_ecn_test.go index 3f501b707..625fd659b 100644 --- a/sysfs/net_class_ecn_test.go +++ b/sysfs/net_class_ecn_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/net_class_test.go b/sysfs/net_class_test.go index 4784fe413..12cade6ad 100644 --- a/sysfs/net_class_test.go +++ b/sysfs/net_class_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/pci_device.go b/sysfs/pci_device.go index 1ac7ee267..a031583fa 100644 --- a/sysfs/pci_device.go +++ b/sysfs/pci_device.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/pci_device_test.go b/sysfs/pci_device_test.go index 3b7f7449f..d1b69eb1e 100644 --- a/sysfs/pci_device_test.go +++ b/sysfs/pci_device_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/system_cpu.go b/sysfs/system_cpu.go index a4b2c9eaf..1c66eab4b 100644 --- a/sysfs/system_cpu.go +++ b/sysfs/system_cpu.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/system_cpu_test.go b/sysfs/system_cpu_test.go index beecb4086..5ef930e41 100644 --- a/sysfs/system_cpu_test.go +++ b/sysfs/system_cpu_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/vmstat_numa.go b/sysfs/vmstat_numa.go index 038a0ee3b..851082caa 100644 --- a/sysfs/vmstat_numa.go +++ b/sysfs/vmstat_numa.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/vmstat_numa_test.go b/sysfs/vmstat_numa_test.go index 9b48987ed..6da83cf58 100644 --- a/sysfs/vmstat_numa_test.go +++ b/sysfs/vmstat_numa_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/vulnerability.go b/sysfs/vulnerability.go index 5a14a3e72..ac8558898 100644 --- a/sysfs/vulnerability.go +++ b/sysfs/vulnerability.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/sysfs/vulnerability_test.go b/sysfs/vulnerability_test.go index 561640e47..837fa689c 100644 --- a/sysfs/vulnerability_test.go +++ b/sysfs/vulnerability_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package sysfs diff --git a/vm.go b/vm.go index 51c49d89e..b475a4ad5 100644 --- a/vm.go +++ b/vm.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/vm_test.go b/vm_test.go index 4bf405247..39592de57 100644 --- a/vm_test.go +++ b/vm_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/zoneinfo.go b/zoneinfo.go index e54d94b09..c5c35af48 100644 --- a/zoneinfo.go +++ b/zoneinfo.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/zoneinfo_test.go b/zoneinfo_test.go index da5574449..44a05322c 100644 --- a/zoneinfo_test.go +++ b/zoneinfo_test.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs