From 0fd1f013a3c16088ea70b91b4ba5acc97f698ab7 Mon Sep 17 00:00:00 2001 From: muXxer Date: Wed, 8 May 2024 22:22:24 +0200 Subject: [PATCH] Fix linter errors --- components/prometheus/collector/collector.go | 2 ++ pkg/toolset/benchmark.go | 4 ++-- pkg/toolset/pwd_hash.go | 2 +- pkg/toolset/toolset.go | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/prometheus/collector/collector.go b/components/prometheus/collector/collector.go index 86d6df611..7f575fab1 100644 --- a/components/prometheus/collector/collector.go +++ b/components/prometheus/collector/collector.go @@ -43,6 +43,7 @@ func (c *Collector) Collect() { metric.collect() return true }) + return true }) } @@ -89,6 +90,7 @@ func (c *Collector) Shutdown() { metric.shutdown() return true }) + return true }) } diff --git a/pkg/toolset/benchmark.go b/pkg/toolset/benchmark.go index 24d78f33c..6e6ccfd2c 100644 --- a/pkg/toolset/benchmark.go +++ b/pkg/toolset/benchmark.go @@ -69,7 +69,7 @@ func benchmarkIO(args []string) error { ts := time.Now() lastStatusTime := time.Now() - for i := 0; i < objectCnt; i++ { + for i := range objectCnt { // one read operation and one write operation per cycle batchWriter.Enqueue(newBenchmarkObject(store, writeDoneWaitGroup, iotago_tpkg.RandBytes(32), iotago_tpkg.RandBytes(size))) @@ -154,7 +154,7 @@ func benchmarkCPU(args []string) error { } }() - for i := 0; i < numWorkers; i++ { + for range numWorkers { wg.Add(1) go func() { defer wg.Done() diff --git a/pkg/toolset/pwd_hash.go b/pkg/toolset/pwd_hash.go index ae366b119..a77d9a789 100644 --- a/pkg/toolset/pwd_hash.go +++ b/pkg/toolset/pwd_hash.go @@ -1,3 +1,4 @@ +//nolint:err113 package toolset import ( @@ -128,7 +129,6 @@ func hashPasswordAndSalt(args []string) error { } if *outputJSONFlag { - result := struct { Password string `json:"passwordHash"` Salt string `json:"passwordSalt"` diff --git a/pkg/toolset/toolset.go b/pkg/toolset/toolset.go index a60d13edc..66b2641c3 100644 --- a/pkg/toolset/toolset.go +++ b/pkg/toolset/toolset.go @@ -55,6 +55,7 @@ const ( ) const ( + //nolint:gosec // there is no hardcoded password passwordEnvKey = "IOTA_CORE_TOOL_PASSWORD" // printStatusInterval is the interval for printing status messages.