Skip to content

Commit

Permalink
update golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ShoshinNikita committed Jul 3, 2024
1 parent 8a61be8 commit e7c9a1a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
13 changes: 5 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion cmd/rview_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
4 changes: 2 additions & 2 deletions tests/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion thumbnails/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion thumbnails/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit e7c9a1a

Please sign in to comment.