diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2022-02-02 03:19:00 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2022-02-02 03:19:00 +0300 |
commit | 9e0d895cb3cc337385d3d3d5b67fc3487eb1f7f7 (patch) | |
tree | b111a58986b9bef66f59ac05c34c39880482176f | |
parent | 03de582b06f276f18e8df0e6f29735119498880d (diff) | |
parent | c387e5459bd486a966885d82070859653f37ca45 (diff) |
Merge branch 'remove/golint' into 'master'
build: replace golint with revive and staticcheck
See merge request gitlab-org/gitlab-pages!649
-rw-r--r-- | .golangci.yml | 9 | ||||
-rw-r--r-- | internal/vfs/zip/vfs_test.go | 2 | ||||
-rw-r--r-- | test/acceptance/acme_test.go | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/.golangci.yml b/.golangci.yml index 33467c49..c9fc0444 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,6 +37,12 @@ linters-settings: min-occurrences: 3 goimports: local-prefixes: gitlab.com/gitlab-org/gitlab-pages + staticcheck: + # Select the Go version to target. + # Default: 1.13 + go: "1.16" + # https://staticcheck.io/docs/options#checks + checks: [ "all" ] linters: disable-all: true @@ -49,12 +55,13 @@ linters: - goconst - gocyclo - goimports - - golint - gosimple - govet - gosec - ineffassign - misspell + - revive + - staticcheck - structcheck - typecheck - unconvert diff --git a/internal/vfs/zip/vfs_test.go b/internal/vfs/zip/vfs_test.go index 4de0240a..12e82c1c 100644 --- a/internal/vfs/zip/vfs_test.go +++ b/internal/vfs/zip/vfs_test.go @@ -169,7 +169,7 @@ func TestVFSFindOrOpenArchiveRefresh(t *testing.T) { for name, test := range tests { t.Run(name, func(t *testing.T) { withExpectedArchiveCount(t, 1, func(t *testing.T) { - cfg := *&zipCfg + cfg := zipCfg cfg.ExpirationInterval = test.expirationInterval cfg.RefreshInterval = test.refreshInterval diff --git a/test/acceptance/acme_test.go b/test/acceptance/acme_test.go index f0259e05..77c4d6c0 100644 --- a/test/acceptance/acme_test.go +++ b/test/acceptance/acme_test.go @@ -41,8 +41,8 @@ func TestAcmeChallengesWhenItIsNotConfigured(t *testing.T) { rsp, err := GetRedirectPage(t, httpListener, "withacmechallenge.domain.com", test.token) - defer rsp.Body.Close() require.NoError(t, err) + defer rsp.Body.Close() require.Equal(t, test.expectedStatus, rsp.StatusCode) body, err := io.ReadAll(rsp.Body) require.NoError(t, err) @@ -82,8 +82,8 @@ func TestAcmeChallengesWhenItIsConfigured(t *testing.T) { rsp, err := GetRedirectPage(t, httpListener, "withacmechallenge.domain.com", test.token) - defer rsp.Body.Close() require.NoError(t, err) + defer rsp.Body.Close() require.Equal(t, test.expectedStatus, rsp.StatusCode) body, err := io.ReadAll(rsp.Body) require.NoError(t, err) |