Skip to content

Commit

Permalink
Merge pull request #878 from go-kivik/newLinter
Browse files Browse the repository at this point in the history
Update linter
  • Loading branch information
flimzy authored Feb 9, 2024
2 parents d6d5149 + 7c3840f commit 03f2b89
Show file tree
Hide file tree
Showing 40 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ variables:

linter:
stage: test
image: golangci/golangci-lint:v1.55.2
image: golangci/golangci-lint:v1.56.1
script:
- go mod download
- golangci-lint run ./...
Expand Down
2 changes: 1 addition & 1 deletion cmd/kivik/cmd/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func Test_copy_RunE(t *testing.T) {
args: []string{"--debug", "copy", ss.URL + "/asdf/src", ts.URL + "/qwerty/target?rev=7-qhk"},
}
})
tests.Add("from context", func(t *testing.T) interface{} {
tests.Add("from context", func(*testing.T) interface{} {
return cmdTest{
args: []string{"--debug", "copy", "--config", "./testdata/copy.yaml", "--target", "target"},
status: errors.ErrUnavailable,
Expand Down
4 changes: 2 additions & 2 deletions cmd/kivik/cmd/delete_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_delete_attachment_RunE(t *testing.T) {
args: []string{"delete", "attachment"},
status: errors.ErrUsage,
})
tests.Add("success", func(t *testing.T) interface{} {
tests.Add("success", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -45,7 +45,7 @@ func Test_delete_attachment_RunE(t *testing.T) {
args: []string{"delete", "attachment", s.URL + "/db/doc/foo.txt", "-O", "rev=1-xxx"},
}
})
tests.Add("no rev", func(t *testing.T) interface{} {
tests.Add("no rev", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusConflict,
Header: http.Header{
Expand Down
2 changes: 1 addition & 1 deletion cmd/kivik/cmd/delete_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
func Test_delete_config_RunE(t *testing.T) {
tests := testy.NewTable()

tests.Add("missing key", func(t *testing.T) interface{} {
tests.Add("missing key", func(*testing.T) interface{} {
return cmdTest{
args: []string{"delete", "config", "http://example.com/foo/"},
status: errors.ErrUsage,
Expand Down
2 changes: 1 addition & 1 deletion cmd/kivik/cmd/delete_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_delete_db_RunE(t *testing.T) {
args: []string{"delete", "database"},
status: errors.ErrUsage,
})
tests.Add("success", func(t *testing.T) interface{} {
tests.Add("success", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
4 changes: 2 additions & 2 deletions cmd/kivik/cmd/delete_doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_delete_doc_RunE(t *testing.T) {
args: []string{"delete", "doc"},
status: errors.ErrUsage,
})
tests.Add("success", func(t *testing.T) interface{} {
tests.Add("success", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -45,7 +45,7 @@ func Test_delete_doc_RunE(t *testing.T) {
args: []string{"delete", "doc", s.URL + "/db/doc", "-O", "rev=1-xxx"},
}
})
tests.Add("no rev", func(t *testing.T) interface{} {
tests.Add("no rev", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusConflict,
Header: http.Header{
Expand Down
8 changes: 4 additions & 4 deletions cmd/kivik/cmd/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_delete_RunE(t *testing.T) {
args: []string{"delete"},
status: errors.ErrUsage,
})
tests.Add("auto delete doc", func(t *testing.T) interface{} {
tests.Add("auto delete doc", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -45,7 +45,7 @@ func Test_delete_RunE(t *testing.T) {
args: []string{"delete", s.URL + "/db/doc", "-O", "rev=1-xxx"},
}
})
tests.Add("auto delete db", func(t *testing.T) interface{} {
tests.Add("auto delete db", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -59,7 +59,7 @@ func Test_delete_RunE(t *testing.T) {
args: []string{"delete", s.URL + "/db"},
}
})
tests.Add("auto delete attachment", func(t *testing.T) interface{} {
tests.Add("auto delete attachment", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -74,7 +74,7 @@ func Test_delete_RunE(t *testing.T) {
args: []string{"delete", s.URL + "/db/doc/filename.txt", "-O", "rev=1-xxx"},
}
})
tests.Add("auto delete config", func(t *testing.T) interface{} {
tests.Add("auto delete config", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
6 changes: 3 additions & 3 deletions cmd/kivik/cmd/describe_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_describe_attachment_RunE(t *testing.T) {
args: []string{"descr", "attachment"},
status: errors.ErrUsage,
})
tests.Add("not found", func(t *testing.T) interface{} {
tests.Add("not found", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusNotFound,
Header: http.Header{
Expand All @@ -45,7 +45,7 @@ func Test_describe_attachment_RunE(t *testing.T) {
status: errors.ErrNotFound,
}
})
tests.Add("success", func(t *testing.T) interface{} {
tests.Add("success", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -61,7 +61,7 @@ func Test_describe_attachment_RunE(t *testing.T) {
args: []string{"descr", "attachment", s.URL + "/db/doc/foo.txt"},
}
})
tests.Add("success json", func(t *testing.T) interface{} {
tests.Add("success json", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
8 changes: 4 additions & 4 deletions cmd/kivik/cmd/describe_doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
func Test_describe_doc_RunE(t *testing.T) {
tests := testy.NewTable()

tests.Add("describe doc", func(t *testing.T) interface{} {
tests.Add("describe doc", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -43,7 +43,7 @@ func Test_describe_doc_RunE(t *testing.T) {
args: []string{"describe", "doc", s.URL + "/foo/bar"},
}
})
tests.Add("describe doc json", func(t *testing.T) interface{} {
tests.Add("describe doc json", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -61,7 +61,7 @@ func Test_describe_doc_RunE(t *testing.T) {
args: []string{"describe", "-f", "json", "doc", s.URL + "/foo/bar"},
}
})
tests.Add("describe doc header", func(t *testing.T) interface{} {
tests.Add("describe doc header", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -80,7 +80,7 @@ func Test_describe_doc_RunE(t *testing.T) {
args: []string{"describe", "-H", "doc", s.URL + "/foo/bar"},
}
})
tests.Add("describe doc verbose", func(t *testing.T) interface{} {
tests.Add("describe doc verbose", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
6 changes: 3 additions & 3 deletions cmd/kivik/cmd/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
func Test_describe_RunE(t *testing.T) {
tests := testy.NewTable()

tests.Add("auto describe doc", func(t *testing.T) interface{} {
tests.Add("auto describe doc", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -43,7 +43,7 @@ func Test_describe_RunE(t *testing.T) {
args: []string{"describe", s.URL + "/foo/bar"},
}
})
tests.Add("auto describe version", func(t *testing.T) interface{} {
tests.Add("auto describe version", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -58,7 +58,7 @@ func Test_describe_RunE(t *testing.T) {
args: []string{"describe", s.URL},
}
})
tests.Add("auto attachment", func(t *testing.T) interface{} {
tests.Add("auto attachment", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
4 changes: 2 additions & 2 deletions cmd/kivik/cmd/describe_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
func Test_describe_version_RunE(t *testing.T) {
tests := testy.NewTable()

tests.Add("describe version", func(t *testing.T) interface{} {
tests.Add("describe version", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -39,7 +39,7 @@ func Test_describe_version_RunE(t *testing.T) {
args: []string{"describe", "version", s.URL},
}
})
tests.Add("describe version json", func(t *testing.T) interface{} {
tests.Add("describe version json", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
6 changes: 3 additions & 3 deletions cmd/kivik/cmd/get_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_get_attachment_RunE(t *testing.T) {
args: []string{"get", "attachment"},
status: errors.ErrUsage,
})
tests.Add("not found", func(t *testing.T) interface{} {
tests.Add("not found", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusNotFound,
Header: http.Header{
Expand All @@ -45,7 +45,7 @@ func Test_get_attachment_RunE(t *testing.T) {
status: errors.ErrNotFound,
}
})
tests.Add("success", func(t *testing.T) interface{} {
tests.Add("success", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -60,7 +60,7 @@ func Test_get_attachment_RunE(t *testing.T) {
args: []string{"get", "attachment", s.URL + "/db/doc/foo.txt"},
}
})
tests.Add("success json", func(t *testing.T) interface{} {
tests.Add("success json", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
4 changes: 2 additions & 2 deletions cmd/kivik/cmd/get_cluster_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_get_clusterSetup_RunE(t *testing.T) {
args: []string{"get", "cluster"},
status: errors.ErrUsage,
})
tests.Add("success", func(t *testing.T) interface{} {
tests.Add("success", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -45,7 +45,7 @@ func Test_get_clusterSetup_RunE(t *testing.T) {
args: []string{"get", "cluster", s.URL},
}
})
tests.Add("success json", func(t *testing.T) interface{} {
tests.Add("success json", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
2 changes: 1 addition & 1 deletion cmd/kivik/cmd/get_databases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
func Test_get_all_databases_RunE(t *testing.T) {
tests := testy.NewTable()

tests.Add("get all-dbs", func(t *testing.T) interface{} {
tests.Add("get all-dbs", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
2 changes: 1 addition & 1 deletion cmd/kivik/cmd/get_security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_get_sec_RunE(t *testing.T) {
args: []string{"get", "sec"},
status: errors.ErrUsage,
})
tests.Add("success", func(t *testing.T) interface{} {
tests.Add("success", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
18 changes: 9 additions & 9 deletions cmd/kivik/cmd/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Test_get_RunE(t *testing.T) {
args: []string{"--debug", "--config", "./testdata/localhost.yaml", "get", "bar"},
status: errors.ErrUnavailable,
})
tests.Add("not found", func(t *testing.T) interface{} {
tests.Add("not found", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusNotFound,
})
Expand All @@ -60,7 +60,7 @@ func Test_get_RunE(t *testing.T) {
status: errors.ErrNotFound,
}
})
tests.Add("invalid JSON response", func(t *testing.T) interface{} {
tests.Add("invalid JSON response", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -75,7 +75,7 @@ func Test_get_RunE(t *testing.T) {
status: errors.ErrProtocol,
}
})
tests.Add("success", func(t *testing.T) interface{} {
tests.Add("success", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -93,7 +93,7 @@ func Test_get_RunE(t *testing.T) {
args: []string{"get", s.URL + "/db/doc"},
}
})
tests.Add("get database", func(t *testing.T) interface{} {
tests.Add("get database", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -107,7 +107,7 @@ func Test_get_RunE(t *testing.T) {
args: []string{"get", "database", s.URL + "/foo"},
}
})
tests.Add("auto get database", func(t *testing.T) interface{} {
tests.Add("auto get database", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -121,7 +121,7 @@ func Test_get_RunE(t *testing.T) {
args: []string{"--debug", "get", s.URL + "/foo"},
}
})
tests.Add("describe database", func(t *testing.T) interface{} {
tests.Add("describe database", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -135,7 +135,7 @@ func Test_get_RunE(t *testing.T) {
args: []string{"describe", "database", s.URL + "/foo"},
}
})
tests.Add("auto version", func(t *testing.T) interface{} {
tests.Add("auto version", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -150,7 +150,7 @@ func Test_get_RunE(t *testing.T) {
args: []string{"get", s.URL},
}
})
tests.Add("auto attachment", func(t *testing.T) interface{} {
tests.Add("auto attachment", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -165,7 +165,7 @@ func Test_get_RunE(t *testing.T) {
args: []string{"get", s.URL + "/db/doc/foo.txt"},
}
})
tests.Add("auto all-dbs", func(t *testing.T) interface{} {
tests.Add("auto all-dbs", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand Down
6 changes: 3 additions & 3 deletions cmd/kivik/cmd/get_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
func Test_get_version_RunE(t *testing.T) {
tests := testy.NewTable()

tests.Add("get version", func(t *testing.T) interface{} {
tests.Add("get version", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -41,7 +41,7 @@ func Test_get_version_RunE(t *testing.T) {
args: []string{"get", "version", s.URL},
}
})
tests.Add("get version json", func(t *testing.T) interface{} {
tests.Add("get version json", func(*testing.T) interface{} {
s := testy.ServeResponse(&http.Response{
StatusCode: http.StatusOK,
Header: http.Header{
Expand All @@ -56,7 +56,7 @@ func Test_get_version_RunE(t *testing.T) {
args: []string{"get", "version", s.URL, "-f", "json"},
}
})
tests.Add("get version no url", func(t *testing.T) interface{} {
tests.Add("get version no url", func(*testing.T) interface{} {
return cmdTest{
args: []string{"get", "version"},
status: errors.ErrUsage,
Expand Down
Loading

0 comments on commit 03f2b89

Please sign in to comment.