diff --git a/.golangci.yml b/.golangci.yml index 1f1b0f63..8731aefd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,17 +1,9 @@ linters: enable: - depguard + - goimports - misspell - revive - disable: - # Disable soon to deprecated[1] linters that lead to false - # positives when build tags disable certain files[2] - # 1: https://github.com/golangci/golangci-lint/issues/1841 - # 2: https://github.com/prometheus/node_exporter/issues/1545 - - deadcode - - unused - - structcheck - - varcheck issues: exclude-rules: diff --git a/collector/cpufreq_linux.go b/collector/cpufreq_linux.go index d6b3e42d..79e2308c 100644 --- a/collector/cpufreq_linux.go +++ b/collector/cpufreq_linux.go @@ -18,10 +18,11 @@ package collector import ( "fmt" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/procfs/sysfs" "log/slog" "strings" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/procfs/sysfs" ) type cpuFreqCollector struct { diff --git a/collector/interrupts_common.go b/collector/interrupts_common.go index 08baa106..80cd7171 100644 --- a/collector/interrupts_common.go +++ b/collector/interrupts_common.go @@ -18,9 +18,10 @@ package collector import ( + "log/slog" + "github.com/alecthomas/kingpin/v2" "github.com/prometheus/client_golang/prometheus" - "log/slog" ) type interruptsCollector struct { diff --git a/collector/runit.go b/collector/runit.go index 8065d90c..2813bfd0 100644 --- a/collector/runit.go +++ b/collector/runit.go @@ -17,10 +17,11 @@ package collector import ( + "log/slog" + "github.com/alecthomas/kingpin/v2" "github.com/prometheus-community/go-runit/runit" "github.com/prometheus/client_golang/prometheus" - "log/slog" ) var runitServiceDir = kingpin.Flag("collector.runit.servicedir", "Path to runit service directory.").Default("/etc/service").String() diff --git a/collector/selinux_linux.go b/collector/selinux_linux.go index 9000fe0d..f10b43fa 100644 --- a/collector/selinux_linux.go +++ b/collector/selinux_linux.go @@ -17,9 +17,10 @@ package collector import ( + "log/slog" + "github.com/opencontainers/selinux/go-selinux" "github.com/prometheus/client_golang/prometheus" - "log/slog" ) type selinuxCollector struct { diff --git a/collector/softirqs_common.go b/collector/softirqs_common.go index cd9ccb94..73a9f7be 100644 --- a/collector/softirqs_common.go +++ b/collector/softirqs_common.go @@ -18,9 +18,10 @@ package collector import ( "fmt" + "log/slog" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs" - "log/slog" ) type softirqsCollector struct { diff --git a/collector/uname.go b/collector/uname.go index 6b4f06e5..c3e96b0b 100644 --- a/collector/uname.go +++ b/collector/uname.go @@ -18,8 +18,9 @@ package collector import ( - "github.com/prometheus/client_golang/prometheus" "log/slog" + + "github.com/prometheus/client_golang/prometheus" ) var unameDesc = prometheus.NewDesc(