Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@ linters:
- linters:
- errcheck
path: _test.go
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
settings:
goimports:
local-prefixes:
- github.com/prometheus/node_exporter
2 changes: 1 addition & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.0
GOLANGCI_LINT_VERSION ?= v2.6.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.
Expand Down
1 change: 0 additions & 1 deletion collector/arp_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !noarp
// +build !noarp

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/bcache_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nobcache
// +build !nobcache

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/bonding_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nobonding
// +build !nobonding

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/bonding_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nobonding
// +build !nobonding

package collector

Expand Down
2 changes: 0 additions & 2 deletions collector/boot_time_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// limitations under the License.

//go:build (freebsd || dragonfly || openbsd || netbsd || darwin) && !noboottime
// +build freebsd dragonfly openbsd netbsd darwin
// +build !noboottime

package collector

Expand Down
4 changes: 2 additions & 2 deletions collector/boot_time_solaris.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// limitations under the License.

//go:build !noboottime
// +build !noboottime

package collector

import (
"log/slog"

"github.com/illumos/go-kstat"
"github.com/prometheus/client_golang/prometheus"
"log/slog"
)

type bootTimeCollector struct {
Expand Down
1 change: 0 additions & 1 deletion collector/btrfs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nobtrfs
// +build !nobtrfs

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/btrfs_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nobtrfs
// +build !nobtrfs

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/buddyinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nobuddyinfo && !netbsd
// +build !nobuddyinfo,!netbsd

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cgroups_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nostat
// +build !nostat

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/conntrack_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !noconntrack
// +build !noconntrack

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_aix.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// BSD. See https://github.com/shirou/gopsutil/blob/master/LICENSE for details.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_dragonfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_dragonfly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_netbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_netbsd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_openbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpu_solaris.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpufreq_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpufreq_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/cpufreq_solaris.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nocpu
// +build !nocpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/devstat_dragonfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nodevstat
// +build !nodevstat

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/devstat_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nodevstat
// +build !nodevstat

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/diskstats_aix.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nodiskstats
// +build !nodiskstats

package collector

Expand Down
2 changes: 0 additions & 2 deletions collector/diskstats_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// limitations under the License.

//go:build !nodiskstats && (openbsd || linux || darwin || aix)
// +build !nodiskstats
// +build openbsd linux darwin aix

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/diskstats_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nodiskstats
// +build !nodiskstats

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/diskstats_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nodiskstats
// +build !nodiskstats

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/diskstats_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nodiskstats
// +build !nodiskstats

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/diskstats_openbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nodiskstats && !amd64
// +build !nodiskstats,!amd64

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/diskstats_openbsd_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nodiskstats
// +build !nodiskstats

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/dmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build linux && !nodmi
// +build linux,!nodmi

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/drbd_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nodrbd
// +build !nodrbd

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/drm_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !nogpu
// +build !nogpu

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/edac_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !noedac
// +build !noedac

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/entropy_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !noentropy
// +build !noentropy

package collector

Expand Down
1 change: 0 additions & 1 deletion collector/ethtool_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !noethtool
// +build !noethtool

// The hard work of collecting data from the kernel via the ethtool interfaces is done by
// https://github.com/safchain/ethtool/
Expand Down
1 change: 0 additions & 1 deletion collector/ethtool_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

//go:build !noethtool
// +build !noethtool

package collector

Expand Down
5 changes: 2 additions & 3 deletions collector/exec_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
// limitations under the License.

//go:build (freebsd || dragonfly) && !noexec
// +build freebsd dragonfly
// +build !noexec

package collector

import (
"github.com/prometheus/client_golang/prometheus"
"log/slog"

"github.com/prometheus/client_golang/prometheus"
)

type execCollector struct {
Expand Down
Loading
Loading