Enable stylecheck linter

Add stylecheck linter to golangci-lint.
* Fix style issues.

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2024-02-14 14:48:09 +01:00
parent 6d18ce7bca
commit e5b09ec144
No known key found for this signature in database
GPG Key ID: C646B23C9E3245F1
2 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ linters:
enable: enable:
- misspell - misspell
- revive - revive
- stylecheck
disable: disable:
# Disable soon to deprecated[1] linters that lead to false # Disable soon to deprecated[1] linters that lead to false
# positives when build tags disable certain files[2] # positives when build tags disable certain files[2]

View File

@ -84,7 +84,7 @@ func NewCPUCollector(logger log.Logger) (Collector, error) {
isolcpus, err := sysfs.IsolatedCPUs() isolcpus, err := sysfs.IsolatedCPUs()
if err != nil { if err != nil {
if !os.IsNotExist(err) { if !os.IsNotExist(err) {
return nil, fmt.Errorf("Unable to get isolated cpus: %w", err) return nil, fmt.Errorf("unable to get isolated cpus: %w", err)
} }
level.Debug(logger).Log("msg", "Could not open isolated file", "error", err) level.Debug(logger).Log("msg", "Could not open isolated file", "error", err)
} }