Skip to content

Commit

Permalink
Merge pull request #872 from cloudflare/dependabot/go_modules/tools/g…
Browse files Browse the repository at this point in the history
…olangci-lint/github.com/golangci/golangci-lint-1.56.2

Bump github.com/golangci/golangci-lint from 1.56.0 to 1.56.2 in /tools/golangci-lint
  • Loading branch information
prymitive authored Feb 21, 2024
2 parents 5fa64e3 + faf2c00 commit d9e7b3b
Show file tree
Hide file tree
Showing 37 changed files with 268 additions and 267 deletions.
8 changes: 4 additions & 4 deletions cmd/pint/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func httpServer(ts *testscript.TestScript, _ bool, args []string) {
code, err := strconv.Atoi(args[3])
ts.Check(err)
body := strings.Join(args[4:], " ")
mocks.add(name, httpMock{pattern: path, handler: func(w http.ResponseWriter, r *http.Request) {
mocks.add(name, httpMock{pattern: path, handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(code)
_, err := w.Write([]byte(body))
ts.Check(err)
Expand All @@ -104,7 +104,7 @@ func httpServer(ts *testscript.TestScript, _ bool, args []string) {
code, err := strconv.Atoi(args[4])
ts.Check(err)
body := strings.Join(args[5:], " ")
mocks.add(name, httpMock{pattern: path, method: meth, handler: func(w http.ResponseWriter, r *http.Request) {
mocks.add(name, httpMock{pattern: path, method: meth, handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(code)
_, err := w.Write([]byte(body))
ts.Check(err)
Expand Down Expand Up @@ -143,7 +143,7 @@ func httpServer(ts *testscript.TestScript, _ bool, args []string) {
code, err := strconv.Atoi(args[4])
ts.Check(err)
body := strings.Join(args[5:], " ")
mocks.add(name, httpMock{pattern: path, handler: func(w http.ResponseWriter, r *http.Request) {
mocks.add(name, httpMock{pattern: path, handler: func(w http.ResponseWriter, _ *http.Request) {
time.Sleep(delay)
w.WriteHeader(code)
_, err := w.Write([]byte(body))
Expand All @@ -157,7 +157,7 @@ func httpServer(ts *testscript.TestScript, _ bool, args []string) {
name := args[1]
srcpath := regexp.MustCompile(args[2])
dstpath := args[3]
mocks.add(name, httpMock{pattern: srcpath, handler: func(w http.ResponseWriter, r *http.Request) {
mocks.add(name, httpMock{pattern: srcpath, handler: func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Location", dstpath)
w.WriteHeader(http.StatusFound)
}})
Expand Down
20 changes: 10 additions & 10 deletions internal/checks/alerts_annotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestAnnotationCheck(t *testing.T) {
return checks.NewAnnotationCheck(checks.MustTemplatedRegexp("severity"), nil, checks.MustTemplatedRegexp("critical"), nil, true, checks.Warning)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -47,7 +47,7 @@ func TestAnnotationCheck(t *testing.T) {
return checks.NewAnnotationCheck(checks.MustTemplatedRegexp("severity"), nil, checks.MustTemplatedRegexp("critical"), nil, true, checks.Warning)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestAnnotationCheck(t *testing.T) {
return checks.NewAnnotationCheck(checks.MustTemplatedRegexp("severity"), nil, checks.MustTemplatedRegexp("critical"), nil, true, checks.Warning)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down Expand Up @@ -107,7 +107,7 @@ func TestAnnotationCheck(t *testing.T) {
return checks.NewAnnotationCheck(checks.MustTemplatedRegexp("severity"), nil, checks.MustTemplatedRegexp("critical"), nil, true, checks.Warning)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -128,7 +128,7 @@ func TestAnnotationCheck(t *testing.T) {
return checks.NewAnnotationCheck(checks.MustTemplatedRegexp("severity"), nil, checks.MustTemplatedRegexp("critical"), nil, false, checks.Warning)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down Expand Up @@ -176,7 +176,7 @@ func TestAnnotationCheck(t *testing.T) {
return checks.NewAnnotationCheck(checks.MustTemplatedRegexp("for"), nil, checks.MustTemplatedRegexp("{{ $for }}"), nil, true, checks.Bug)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down Expand Up @@ -215,7 +215,7 @@ func TestAnnotationCheck(t *testing.T) {
return checks.NewAnnotationCheck(checks.MustTemplatedRegexp("annotation_.*"), nil, checks.MustTemplatedRegexp("critical"), nil, true, checks.Warning)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -236,7 +236,7 @@ func TestAnnotationCheck(t *testing.T) {
return checks.NewAnnotationCheck(checks.MustTemplatedRegexp("annotation_.*"), nil, checks.MustTemplatedRegexp("critical"), nil, false, checks.Warning)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -257,7 +257,7 @@ func TestAnnotationCheck(t *testing.T) {
return checks.NewAnnotationCheck(checks.MustTemplatedRegexp("components"), checks.MustRawTemplatedRegexp("\\w+"), checks.MustTemplatedRegexp("api|memcached"), nil, false, checks.Bug)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down Expand Up @@ -285,7 +285,7 @@ func TestAnnotationCheck(t *testing.T) {
)
},
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down
12 changes: 6 additions & 6 deletions internal/checks/alerts_comparison_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestComparisonCheck(t *testing.T) {
content: "- alert: Foo Is Down\n expr: up{job=\"foo\"}\n",
checker: newComparisonCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down Expand Up @@ -91,7 +91,7 @@ func TestComparisonCheck(t *testing.T) {
`,
checker: newComparisonCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -118,7 +118,7 @@ func TestComparisonCheck(t *testing.T) {
content: "- alert: Error rate is high\n expr: rate(error_count[5m]) > bool 5\n",
checker: newComparisonCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down Expand Up @@ -173,7 +173,7 @@ func TestComparisonCheck(t *testing.T) {
content: "- alert: Foo Is Down\n expr: (foo > 0) or vector(0)\n",
checker: newComparisonCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -193,7 +193,7 @@ func TestComparisonCheck(t *testing.T) {
content: "- alert: Foo Is Down\n expr: (foo > 0) or vector(0)\n",
checker: newComparisonCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -213,7 +213,7 @@ func TestComparisonCheck(t *testing.T) {
content: "- alert: Foo Is Down\n expr: (foo > 0) or vector(0)\n",
checker: newComparisonCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down
4 changes: 2 additions & 2 deletions internal/checks/alerts_count_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ func TestAlertsCountCheck(t *testing.T) {
description: "connection refused / upstream not required / warning",
content: content,
checker: newAlertsCheck,
prometheus: func(s string) *promapi.FailoverGroup {
prometheus: func(_ string) *promapi.FailoverGroup {
return simpleProm("prom", "http://127.0.0.1:1111", time.Second*5, false)
},
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down
4 changes: 2 additions & 2 deletions internal/checks/alerts_external_labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ func TestAlertsExternalLabelsCountCheck(t *testing.T) {
description: "connection refused / upstream not required / warning",
content: content,
checker: newAlertsExternalLabelsCheck,
prometheus: func(s string) *promapi.FailoverGroup {
prometheus: func(_ string) *promapi.FailoverGroup {
return simpleProm("prom", "http://127.0.0.1:1111", time.Second*5, false)
},
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down
12 changes: 6 additions & 6 deletions internal/checks/alerts_for_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestAlertsForCheck(t *testing.T) {
content: "- alert: foo\n expr: foo\n for: abc\n",
checker: newAlertsForCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -53,7 +53,7 @@ func TestAlertsForCheck(t *testing.T) {
content: "- alert: foo\n expr: foo\n for: -5m\n",
checker: newAlertsForCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -73,7 +73,7 @@ func TestAlertsForCheck(t *testing.T) {
content: "- alert: foo\n expr: foo\n for: 0h\n",
checker: newAlertsForCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -92,7 +92,7 @@ func TestAlertsForCheck(t *testing.T) {
content: "- alert: foo\n expr: foo\n keep_firing_for: abc\n",
checker: newAlertsForCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -112,7 +112,7 @@ func TestAlertsForCheck(t *testing.T) {
content: "- alert: foo\n expr: foo\n keep_firing_for: -5m\n",
checker: newAlertsForCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand All @@ -132,7 +132,7 @@ func TestAlertsForCheck(t *testing.T) {
content: "- alert: foo\n expr: foo\n keep_firing_for: 0h\n",
checker: newAlertsForCheck,
prometheus: noProm,
problems: func(uri string) []checks.Problem {
problems: func(_ string) []checks.Problem {
return []checks.Problem{
{
Lines: parser.LineRange{
Expand Down
Loading

0 comments on commit d9e7b3b

Please sign in to comment.