diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 29c936b..39e9203 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -16,7 +16,7 @@ jobs: go-version: "1.22.*" - uses: golangci/golangci-lint-action@v6 with: - version: v1.57.2 + version: v1.59.1 args: "-v" # TODO: use an alpine image to mimic the production environment? diff --git a/.golangci.yml b/.golangci.yml index c9acf32..302ceaf 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,32 +6,32 @@ linters: enable: - asciicheck - bodyclose - - durationcheck - errcheck - errname - errorlint - - exportloopref - - goconst - gocritic - - goerr113 - gofmt - goimports - - goprintffuncname - gosec - gosimple - govet - ineffassign + - intrange - misspell - nilerr - nilnil - noctx - nolintlint + - predeclared - revive - staticcheck + - stylecheck - tagliatelle - typecheck + - testifylint - unconvert - unparam + - wastedassign - unused linters-settings: @@ -55,9 +55,6 @@ issues: - linters: - bodyclose path: _test\.go - - linters: - - goerr113 - text: "do not define dynamic errors" - linters: - gosec text: "G203: The used method does not auto-escape HTML" diff --git a/Makefile b/Makefile index 261be90..31c08ca 100644 --- a/Makefile +++ b/Makefile @@ -43,4 +43,4 @@ lint: -v $(shell go env GOPATH)/pkg:/go/pkg \ -v $(shell pwd):/app \ -w /app \ - golangci/golangci-lint:v1.57.2-alpine golangci-lint run -v --config .golangci.yml + golangci/golangci-lint:v1.59.1-alpine golangci-lint run -v --config .golangci.yml diff --git a/cmd/rview_test.go b/cmd/rview_test.go index 4b2f248..828de94 100644 --- a/cmd/rview_test.go +++ b/cmd/rview_test.go @@ -19,7 +19,7 @@ func TestSafeShutdown(t *testing.T) { r.NoError(err) err = safeShutdown(ctx, new(testShutdowner)) - r.Equal(err.Error(), "test") + r.EqualError(err, "test") } type testShutdowner struct{} diff --git a/tests/api_test.go b/tests/api_test.go index df2c700..c8cce7c 100644 --- a/tests/api_test.go +++ b/tests/api_test.go @@ -70,7 +70,7 @@ func startTestRview() { }) // Wait for rclone to start. - for i := 0; i < 10; i++ { + for i := range 10 { if i != 0 { time.Sleep(20 * time.Millisecond) } @@ -82,7 +82,7 @@ func startTestRview() { } // Wait for components to be ready. - for i := 0; i < 10; i++ { + for i := range 10 { if i != 0 { time.Sleep(100 * time.Millisecond) } diff --git a/thumbnails/service.go b/thumbnails/service.go index ce4ea9b..2dceab9 100644 --- a/thumbnails/service.go +++ b/thumbnails/service.go @@ -104,7 +104,7 @@ func (s *ThumbnailService) startWorkers() { } var wg sync.WaitGroup - for i := 0; i < s.workersCount; i++ { + for range s.workersCount { wg.Add(1) go func() { defer wg.Done() diff --git a/thumbnails/service_test.go b/thumbnails/service_test.go index 61771c8..40b72f4 100644 --- a/thumbnails/service_test.go +++ b/thumbnails/service_test.go @@ -71,7 +71,7 @@ func TestThumbnailService(t *testing.T) { r.True(service.IsThumbnailReady(thumbnailID)) // Must ignore duplicate tasks. - for i := 0; i < 3; i++ { + for range 3 { err = service.SendTask(fileID) r.NoError(err) }