From 3218661f695190d17b981e91ca2c3ead3bdc49b5 Mon Sep 17 00:00:00 2001 From: rsclarke Date: Wed, 18 Mar 2026 16:03:36 +0800 Subject: [PATCH] chore(lint): expand golangci-lint with 24 additional linters Enable asciicheck, bidichk, canonicalheader, copyloopvar, errchkjson, errname, exptostd, fatcontext, gocheckcompilerdirectives, gocritic, intrange, mirror, modernize, nakedret, nilnesserr, nosprintfhostport, perfsprint, reassign, recvcheck, thelper, unused, usestdlibvars, usetesting, and wastedassign. Fix intrange findings in storage_test.go by converting counted for loops to range-over-integer. --- .golangci.yml | 28 ++++++++++++++++++++++++++-- storage_test.go | 4 ++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index c479477..db4ec49 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,28 +1,52 @@ version: "2" linters: enable: + - asciicheck + - bidichk - bodyclose + - canonicalheader - contextcheck + - copyloopvar - durationcheck - errcheck + - errchkjson + - errname - errorlint + - exptostd + - fatcontext + - gocheckcompilerdirectives + - gocritic - godot - govet - ineffassign + - intrange + - mirror - misspell + - modernize + - nakedret - nilerr + - nilnesserr - nilnil - noctx - nolintlint + - nosprintfhostport + - perfsprint - predeclared - - rowserrcheck + - reassign + - recvcheck - revive + - rowserrcheck - sqlclosecheck - staticcheck + - thelper - unconvert + - unparam - unqueryvet + - unused + - usestdlibvars + - usetesting + - wastedassign - gosec - - unparam - wrapcheck settings: errorlint: diff --git a/storage_test.go b/storage_test.go index c62f834..06a030b 100644 --- a/storage_test.go +++ b/storage_test.go @@ -381,10 +381,10 @@ func TestConcurrentStoreLoad(t *testing.T) { var wg sync.WaitGroup wg.Add(goroutines) - for i := 0; i < goroutines; i++ { + for range goroutines { go func() { defer wg.Done() - for j := 0; j < iterations; j++ { + for range iterations { key := "concurrent/key" value := []byte("data") if err := s.Store(ctx, key, value); err != nil {