diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 4e0a00e..6bacf0b 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -14,7 +14,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.52.2 + version: v1.54.2 args: --verbose test: diff --git a/.golangci.yml b/.golangci.yml index 7a10f36..ba18d1c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -64,3 +64,4 @@ linters: run: issues-exit-code: 1 + timeout: 5m diff --git a/.vscode/settings.json b/.vscode/settings.json index 0058745..4d2b931 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,6 +7,7 @@ "Assistable", "bodyclose", "coverpkg", + "coverprofile", "cubiest", "deadcode", "depguard", @@ -24,10 +25,12 @@ "gocyclo", "gofmt", "goimports", + "golangci", "goleak", "gomnd", "gosec", "gosimple", + "goveralls", "govet", "graffico", "ineffassign", @@ -35,16 +38,20 @@ "leaktest", "linters", "lorax", + "mattn", "nakedret", "nolint", "nolintlint", + "onsi", "passthru", "pixa", "prealloc", "repotoken", + "shogo", "sidewalk", "skeletor", "smaug", + "snivilised", "staticcheck", "structcheck", "stylecheck", diff --git a/boost/annotated-wait-group.go b/boost/annotated-wait-group.go index 44086ff..5a19606 100644 --- a/boost/annotated-wait-group.go +++ b/boost/annotated-wait-group.go @@ -4,6 +4,7 @@ import ( "fmt" "strings" "sync" + "sync/atomic" "github.com/samber/lo" ) @@ -74,7 +75,7 @@ type waitGroupAnImpl struct { } func (a *waitGroupAnImpl) Add(delta int, name ...GoRoutineName) { - a.counter += int32(delta) + atomic.AddInt32(&a.counter, int32(delta)) if len(name) > 0 { a.names[name[0]] = "foo" @@ -84,7 +85,7 @@ func (a *waitGroupAnImpl) Add(delta int, name ...GoRoutineName) { } func (a *waitGroupAnImpl) Done(name ...GoRoutineName) { - a.counter-- + atomic.AddInt32(&a.counter, int32(-1)) if len(name) > 0 { delete(a.names, name[0])