diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49c90f5..b87e8fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ["1.22"] + go: ["1.23"] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -31,9 +31,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: "1.23" cache: false - name: Run lint uses: golangci/golangci-lint-action@v6 with: - version: v1.58 + version: v1.62 diff --git a/.golangci.yml b/.golangci.yml index 6d38c7f..f264452 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,6 +9,20 @@ linters-settings: disable: - shadow enable-all: true + testifylint: + disable: + - require-error + - error-nil + - formatter + - encoded-compare + revive: + rules: + - name: var-naming + arguments: + - [] # AllowList + - ["DTO"] # DenyList + - name: unused-parameter + disabled: false linters: enable: @@ -19,12 +33,14 @@ linters: - govet - unused - errcheck - - exportloopref + - copyloopvar - gosimple - ineffassign - staticcheck - testifylint + - whitespace - bodyclose + - inamedparam disable-all: false fast: false @@ -34,6 +50,9 @@ issues: max-same-issues: 0 exclude-dirs: - .github + - .storage + - .vscode + - resources exclude: - should have a package comment - for error assertions use require diff --git a/http/middleware/owner_test.go b/http/middleware/owner_test.go index a287bac..5b959ff 100644 --- a/http/middleware/owner_test.go +++ b/http/middleware/owner_test.go @@ -25,7 +25,6 @@ func (s ownerServiceMock) IsOwner(_ context.Context, _, _ uint) (bool, error) { } func TestOwner(t *testing.T) { - cases := []struct { service ownerServiceMock articleID string diff --git a/http/validation/password_test.go b/http/validation/password_test.go index c92723a..2597e98 100644 --- a/http/validation/password_test.go +++ b/http/validation/password_test.go @@ -9,7 +9,6 @@ import ( ) func TestPasswordValidator(t *testing.T) { - cases := []struct { value any want bool diff --git a/service/user/user.go b/service/user/user.go index 8f3c85c..b9f961d 100644 --- a/service/user/user.go +++ b/service/user/user.go @@ -28,8 +28,8 @@ type Repository interface { type StorageService interface { GetFS() fs.StatFS - SaveAvatar(fsutil.File) (string, error) - Delete(string) error + SaveAvatar(file fsutil.File) (string, error) + Delete(path string) error } type Service struct {