Enable goimports linter
Enable `goimports` golangci-lint linter and fix issues. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
0fddfd1ba5
commit
16e2a50b76
|
@ -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:
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue