diff --git a/cmd/pint/main_test.go b/cmd/pint/main_test.go index f3f25257..4c74efa1 100644 --- a/cmd/pint/main_test.go +++ b/cmd/pint/main_test.go @@ -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) @@ -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) @@ -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)) @@ -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) }}) diff --git a/internal/checks/alerts_annotation_test.go b/internal/checks/alerts_annotation_test.go index b241125f..50dbde10 100644 --- a/internal/checks/alerts_annotation_test.go +++ b/internal/checks/alerts_annotation_test.go @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ diff --git a/internal/checks/alerts_comparison_test.go b/internal/checks/alerts_comparison_test.go index 7077cd17..271ae1f2 100644 --- a/internal/checks/alerts_comparison_test.go +++ b/internal/checks/alerts_comparison_test.go @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ diff --git a/internal/checks/alerts_count_test.go b/internal/checks/alerts_count_test.go index 1046b908..dcae2dae 100644 --- a/internal/checks/alerts_count_test.go +++ b/internal/checks/alerts_count_test.go @@ -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{ diff --git a/internal/checks/alerts_external_labels_test.go b/internal/checks/alerts_external_labels_test.go index e9507889..b1bef41a 100644 --- a/internal/checks/alerts_external_labels_test.go +++ b/internal/checks/alerts_external_labels_test.go @@ -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{ diff --git a/internal/checks/alerts_for_test.go b/internal/checks/alerts_for_test.go index f203329f..ec0cc590 100644 --- a/internal/checks/alerts_for_test.go +++ b/internal/checks/alerts_for_test.go @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ diff --git a/internal/checks/alerts_template_test.go b/internal/checks/alerts_template_test.go index e0ac56c7..c039fe81 100644 --- a/internal/checks/alerts_template_test.go +++ b/internal/checks/alerts_template_test.go @@ -31,7 +31,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: up{job=\"foo\"} == 0\n annotations:\n summary: 'Instance {{ $label.instance }} down'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -51,7 +51,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: up{job=\"foo\"} == 0\n annotations:\n summary: '{{ $value | xxx }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -78,7 +78,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: up{job=\"foo\"} == 0\n labels:\n summary: 'Instance {{ $label.instance }} down'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -98,7 +98,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: up{job=\"foo\"} == 0\n labels:\n summary: '{{ $value | xxx }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -125,7 +125,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: bar\n '{{ $value}}': bar\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -144,7 +144,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: bar\n '{{ $value }}': bar\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -163,7 +163,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: bar\n baz: '{{$value}}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -182,7 +182,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: '{{ .Value }}'\n baz: '{{$value}}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -210,7 +210,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: bar\n baz: |\n foo is {{ $value | humanizePercentage }}%\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -229,7 +229,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: bar\n baz: |\n foo is {{$value|humanizePercentage}}%\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -248,7 +248,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: bar\n baz: 'value {{ .Value }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -267,7 +267,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: bar\n baz: '{{ .Value|humanize }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -286,7 +286,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: bar\n baz: '{{ $foo := $value }}{{ $foo }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -305,7 +305,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: foo\n expr: sum(foo)\n labels:\n foo: bar\n baz: '{{ $foo := .Value }}{{ $foo }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -324,7 +324,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: sum(foo) > 0\n annotations:\n summary: '{{ $labels.job }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -344,7 +344,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: sum(foo) > 0\n annotations:\n summary: '{{ .Labels.job }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -364,7 +364,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: sum(foo) without(job) > 0\n annotations:\n summary: '{{ $labels.job }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -384,7 +384,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: sum(foo) without(job) > 0\n annotations:\n summary: '{{ .Labels.job }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -404,7 +404,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: sum(foo) without(job) > 0\n labels:\n summary: '{{ $labels.job }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -424,7 +424,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: sum(foo) by(job) or sum(bar)\n annotations:\n summary: '{{ .Labels.job }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -444,7 +444,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: Foo Is Down\n expr: 1 + sum(foo) by(notjob)\n annotations:\n summary: '{{ .Labels.job }}'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -470,7 +470,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -526,7 +526,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -593,7 +593,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -618,7 +618,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -643,7 +643,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -738,7 +738,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -762,7 +762,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -786,7 +786,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -810,7 +810,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -933,7 +933,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -961,7 +961,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -986,7 +986,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -1023,7 +1023,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -1065,7 +1065,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { {{ with printf "sum({job='%s'})" .Labels.job | query }} @@ -1129,7 +1129,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: DeadMansSwitch\n expr: vector(1)\n annotations:\n summary: 'Deadmans switch on {{ $labels.instance }} is firing'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -1149,7 +1149,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: DeadMansSwitch\n expr: vector(1)\n labels:\n summary: 'Deadmans switch on {{ $labels.instance }} is firing'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -1169,7 +1169,7 @@ func TestTemplateCheck(t *testing.T) { content: "- alert: DeadMansSwitch\n expr: 1 > bool 0\n annotations:\n summary: 'Deadmans switch on {{ $labels.instance }} / {{ $labels.job }} is firing'\n", checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -1205,7 +1205,7 @@ func TestTemplateCheck(t *testing.T) { `, checker: newTemplateCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/base_test.go b/internal/checks/base_test.go index 54e645e0..a87252e3 100644 --- a/internal/checks/base_test.go +++ b/internal/checks/base_test.go @@ -164,7 +164,7 @@ func runTests(t *testing.T, testCases []checkTest) { expr: 'foo{}{}' `) require.NoError(t, err, "cannot parse rule content") - t.Run(tc.description+" (bogus rules)", func(t *testing.T) { + t.Run(tc.description+" (bogus rules)", func(_ *testing.T) { for _, entry := range entries { _ = tc.checker(newSimpleProm("prom")).Check(context.Background(), entry.SourcePath, entry.Rule, tc.entries) } diff --git a/internal/checks/labels_conflict_test.go b/internal/checks/labels_conflict_test.go index 82ddf207..a50dd9c2 100644 --- a/internal/checks/labels_conflict_test.go +++ b/internal/checks/labels_conflict_test.go @@ -48,7 +48,7 @@ func TestLabelsConflictCheck(t *testing.T) { prometheus: func(_ string) *promapi.FailoverGroup { return simpleProm("prom", "http://127.0.0.1:1111", time.Second, false) }, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/promql_fragile_test.go b/internal/checks/promql_fragile_test.go index 7030693f..10d5a208 100644 --- a/internal/checks/promql_fragile_test.go +++ b/internal/checks/promql_fragile_test.go @@ -56,7 +56,7 @@ func TestFragileCheck(t *testing.T) { content: "- record: foo\n expr: foo / sum(bar) without(job)\n", checker: newFragileCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -75,7 +75,7 @@ func TestFragileCheck(t *testing.T) { content: "- record: foo\n expr: sum(foo) without(job) + sum(bar) without(job)\n", checker: newFragileCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -94,7 +94,7 @@ func TestFragileCheck(t *testing.T) { content: "- alert: foo\n expr: (sum(foo) without(job) + sum(bar) without(job)) > 1\n", checker: newFragileCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -113,7 +113,7 @@ func TestFragileCheck(t *testing.T) { content: "- alert: foo\n expr: (foo / sum(bar) without(job)) > 1\n", checker: newFragileCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -132,7 +132,7 @@ func TestFragileCheck(t *testing.T) { content: "- alert: foo\n expr: (sum(foo) without(job) + sum(bar)) > 1 unless sum(bob) without(job) < 10\n", checker: newFragileCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/promql_rate_test.go b/internal/checks/promql_rate_test.go index 512ab367..18a5ef4f 100644 --- a/internal/checks/promql_rate_test.go +++ b/internal/checks/promql_rate_test.go @@ -432,7 +432,7 @@ func TestRateCheck(t *testing.T) { prometheus: func(_ string) *promapi.FailoverGroup { return simpleProm("prom", "http://127.0.0.1:1111", time.Second, true) }, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -667,7 +667,7 @@ func TestRateCheck(t *testing.T) { entries: mustParseContent("- record: my:sum\n expr: sum(foo)\n"), checker: newRateCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/promql_regexp_test.go b/internal/checks/promql_regexp_test.go index 1a9b467e..36744c1a 100644 --- a/internal/checks/promql_regexp_test.go +++ b/internal/checks/promql_regexp_test.go @@ -61,7 +61,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job=~\"bar\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -81,7 +81,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job!~\"bar\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -101,7 +101,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job=~\"\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -121,7 +121,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job=~\"^.+$\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -141,7 +141,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job=~\"(foo|^.+)$\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -161,7 +161,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job=~\"bar\"} / foo{job=~\"bar\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -181,7 +181,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job=~\"bar\"} / foo{job=~\"bar\", level=\"total\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -218,7 +218,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job=~\".*\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -245,7 +245,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job!~\".*\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -265,7 +265,7 @@ func TestRegexpCheck(t *testing.T) { content: "- record: foo\n expr: foo{job!~\".+\"}\n", checker: newRegexpCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/promql_series_test.go b/internal/checks/promql_series_test.go index 40a70735..a0042f6e 100644 --- a/internal/checks/promql_series_test.go +++ b/internal/checks/promql_series_test.go @@ -99,10 +99,10 @@ func TestSeriesCheck(t *testing.T) { description: "bad uri", content: "- record: foo\n expr: sum(foo)\n", checker: newSeriesCheck, - prometheus: func(s string) *promapi.FailoverGroup { + prometheus: func(_ string) *promapi.FailoverGroup { return simpleProm("prom", "http://127.127.127.127", time.Second*5, false) }, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -568,7 +568,7 @@ func TestSeriesCheck(t *testing.T) { checker: newSeriesCheck, prometheus: newSimpleProm, entries: mustParseContent("- alert: notmyalert\n expr: sum(foo) == 0\n"), - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/promql_syntax_test.go b/internal/checks/promql_syntax_test.go index 2b98e2ea..8a4c6ad9 100644 --- a/internal/checks/promql_syntax_test.go +++ b/internal/checks/promql_syntax_test.go @@ -33,7 +33,7 @@ func TestSyntaxCheck(t *testing.T) { content: "- record: foo\n expr: sum(\n", checker: newSyntaxCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -53,7 +53,7 @@ func TestSyntaxCheck(t *testing.T) { content: "- record: foo\n expr: sum(foo) by(", checker: newSyntaxCheck, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/promql_vector_matching_test.go b/internal/checks/promql_vector_matching_test.go index 13d49888..afaf4a81 100644 --- a/internal/checks/promql_vector_matching_test.go +++ b/internal/checks/promql_vector_matching_test.go @@ -49,7 +49,7 @@ func TestVectorMatchingCheck(t *testing.T) { content: "- record: foo\n expr: foo_with_notfound / bar\n", checker: newVectorMatchingCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -194,7 +194,7 @@ func TestVectorMatchingCheck(t *testing.T) { content: "- record: foo\n expr: foo / ignoring(xxx) app_registry\n", checker: newVectorMatchingCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -254,7 +254,7 @@ func TestVectorMatchingCheck(t *testing.T) { content: "- record: foo\n expr: foo / on(notfound) bar\n", checker: newVectorMatchingCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -503,7 +503,7 @@ func TestVectorMatchingCheck(t *testing.T) { content: "- record: foo\n expr: foo / on(notfound) bar_with_notfound\n", checker: newVectorMatchingCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -561,7 +561,7 @@ func TestVectorMatchingCheck(t *testing.T) { content: "- record: foo\n expr: foo_with_notfound / on(notfound) bar\n", checker: newVectorMatchingCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -619,7 +619,7 @@ func TestVectorMatchingCheck(t *testing.T) { content: "- alert: foo\n expr: (memory_bytes / ignoring(job) (memory_limit > 0)) * on(app_name) group_left(a,b,c) app_registry\n", checker: newVectorMatchingCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -810,7 +810,7 @@ func TestVectorMatchingCheck(t *testing.T) { content: "- alert: foo\n expr: min_over_time((foo_with_notfound > 0)[30m:1m]) / bar\n", checker: newVectorMatchingCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -941,7 +941,7 @@ func TestVectorMatchingCheck(t *testing.T) { content: "- alert: foo\n expr: (foo / ignoring(notfound) foo_with_notfound) / (memory_bytes / ignoring(job) memory_limit)\n", checker: newVectorMatchingCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -1071,7 +1071,7 @@ func TestVectorMatchingCheck(t *testing.T) { prometheus: func(_ string) *promapi.FailoverGroup { return simpleProm("prom", "http://127.0.0.1:1111", time.Second, true) }, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -1092,7 +1092,7 @@ func TestVectorMatchingCheck(t *testing.T) { prometheus: func(_ string) *promapi.FailoverGroup { return simpleProm("prom", "http://127.0.0.1:1111", time.Second, false) }, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -1199,7 +1199,7 @@ func TestVectorMatchingCheck(t *testing.T) { content: "- record: foo\n expr: up{job=\"a\"} / up{job=\"b\"}\n", checker: newVectorMatchingCheck, prometheus: newSimpleProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/query_cost_test.go b/internal/checks/query_cost_test.go index f8627c1b..e6b2a9c4 100644 --- a/internal/checks/query_cost_test.go +++ b/internal/checks/query_cost_test.go @@ -147,10 +147,10 @@ func TestCostCheck(t *testing.T) { checker: func(prom *promapi.FailoverGroup) checks.RuleChecker { return checks.NewCostCheck(prom, 0, 0, 0, 0, checks.Bug) }, - 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{ diff --git a/internal/checks/rule_dependency_test.go b/internal/checks/rule_dependency_test.go index 1d0b1c2b..184c0ea6 100644 --- a/internal/checks/rule_dependency_test.go +++ b/internal/checks/rule_dependency_test.go @@ -101,7 +101,7 @@ func TestRuleDependencyCheck(t *testing.T) { []string{}, ) }, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Anchor: checks.AnchorBefore, @@ -128,7 +128,7 @@ func TestRuleDependencyCheck(t *testing.T) { return checks.NewRuleDependencyCheck() }, prometheus: newSimpleProm, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Anchor: checks.AnchorBefore, @@ -185,7 +185,7 @@ func TestRuleDependencyCheck(t *testing.T) { return checks.NewRuleDependencyCheck() }, prometheus: newSimpleProm, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Anchor: checks.AnchorBefore, diff --git a/internal/checks/rule_duplicate_test.go b/internal/checks/rule_duplicate_test.go index 26c29b05..6dc02bc7 100644 --- a/internal/checks/rule_duplicate_test.go +++ b/internal/checks/rule_duplicate_test.go @@ -128,7 +128,7 @@ func TestRuleDuplicateCheck(t *testing.T) { return checks.NewRuleDuplicateCheck(prom) }, prometheus: newSimpleProm, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/rule_for_test.go b/internal/checks/rule_for_test.go index ba926313..9847554b 100644 --- a/internal/checks/rule_for_test.go +++ b/internal/checks/rule_for_test.go @@ -72,7 +72,7 @@ func TestRuleForCheck(t *testing.T) { return checks.NewRuleForCheck(checks.RuleForFor, time.Minute*5, time.Minute*10, checks.Warning) }, prometheus: noProm, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -93,7 +93,7 @@ func TestRuleForCheck(t *testing.T) { return checks.NewRuleForCheck(checks.RuleForFor, time.Second, time.Minute*2, checks.Warning) }, prometheus: noProm, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -132,7 +132,7 @@ func TestRuleForCheck(t *testing.T) { return checks.NewRuleForCheck(checks.RuleForKeepFiringFor, time.Minute*5, time.Minute*10, checks.Warning) }, prometheus: noProm, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/rule_label_test.go b/internal/checks/rule_label_test.go index 77886cf4..19d85110 100644 --- a/internal/checks/rule_label_test.go +++ b/internal/checks/rule_label_test.go @@ -17,7 +17,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(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{ @@ -38,7 +38,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(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{ @@ -75,7 +75,7 @@ func TestLabelCheck(t *testing.T) { ) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -105,7 +105,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(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{ @@ -126,7 +126,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(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{ @@ -154,7 +154,7 @@ func TestLabelCheck(t *testing.T) { ) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -182,7 +182,7 @@ func TestLabelCheck(t *testing.T) { ) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -203,7 +203,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(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{ @@ -233,7 +233,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(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{ @@ -263,7 +263,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(checks.MustTemplatedRegexp("severity"), nil, checks.MustTemplatedRegexp("critical|info"), nil, true, checks.Warning) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -284,7 +284,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(checks.MustTemplatedRegexp("severity"), nil, checks.MustTemplatedRegexp("critical|info"), nil, false, checks.Warning) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -350,7 +350,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(checks.MustTemplatedRegexp("for"), nil, checks.MustTemplatedRegexp("must wait {{$for}} to fire"), nil, true, checks.Warning) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -371,7 +371,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(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{ @@ -399,7 +399,7 @@ func TestLabelCheck(t *testing.T) { ) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -421,7 +421,7 @@ func TestLabelCheck(t *testing.T) { return checks.NewLabelCheck(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{ @@ -449,7 +449,7 @@ func TestLabelCheck(t *testing.T) { ) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/rule_link_test.go b/internal/checks/rule_link_test.go index be695e8e..8b4591ec 100644 --- a/internal/checks/rule_link_test.go +++ b/internal/checks/rule_link_test.go @@ -91,7 +91,7 @@ func TestRuleLinkCheck(t *testing.T) { return checks.NewRuleLinkCheck(checks.MustTemplatedRegexp(".*"), "", time.Second, nil, checks.Bug) }, prometheus: noProm, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -133,7 +133,7 @@ func TestRuleLinkCheck(t *testing.T) { ) }, prometheus: noProm, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -160,7 +160,7 @@ func TestRuleLinkCheck(t *testing.T) { ) }, prometheus: noProm, - problems: func(s string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/checks/rule_reject_test.go b/internal/checks/rule_reject_test.go index bc468e9d..b42c76d2 100644 --- a/internal/checks/rule_reject_test.go +++ b/internal/checks/rule_reject_test.go @@ -81,7 +81,7 @@ func TestRejectCheck(t *testing.T) { return checks.NewRejectCheck(true, true, badRe, badRe, checks.Bug) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -102,7 +102,7 @@ func TestRejectCheck(t *testing.T) { return checks.NewRejectCheck(true, true, badRe, badRe, checks.Warning) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -123,7 +123,7 @@ func TestRejectCheck(t *testing.T) { return checks.NewRejectCheck(true, true, badRe, badRe, checks.Bug) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -144,7 +144,7 @@ func TestRejectCheck(t *testing.T) { return checks.NewRejectCheck(true, true, badRe, badRe, checks.Bug) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -184,7 +184,7 @@ func TestRejectCheck(t *testing.T) { return checks.NewRejectCheck(true, true, badRe, badRe, checks.Information) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -205,7 +205,7 @@ func TestRejectCheck(t *testing.T) { return checks.NewRejectCheck(true, true, badRe, badRe, checks.Bug) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ @@ -235,7 +235,7 @@ func TestRejectCheck(t *testing.T) { return checks.NewRejectCheck(true, true, nil, checks.MustTemplatedRegexp("{{ $alert }}"), checks.Bug) }, prometheus: noProm, - problems: func(uri string) []checks.Problem { + problems: func(_ string) []checks.Problem { return []checks.Problem{ { Lines: parser.LineRange{ diff --git a/internal/config/discovery.go b/internal/config/discovery.go index 01d3d09a..38cfb554 100644 --- a/internal/config/discovery.go +++ b/internal/config/discovery.go @@ -313,7 +313,7 @@ func (fp FilePath) Discover(_ context.Context) ([]*promapi.FailoverGroup, error) slog.String("match", re.String()), ) err := filepath.WalkDir(fp.Directory, - func(path string, d fs.DirEntry, err error) error { + func(path string, _ fs.DirEntry, err error) error { if err != nil { return fmt.Errorf("filepath discovery error: %w", err) } diff --git a/internal/discovery/discovery_test.go b/internal/discovery/discovery_test.go index 0919cbf3..f7144d91 100644 --- a/internal/discovery/discovery_test.go +++ b/internal/discovery/discovery_test.go @@ -50,7 +50,7 @@ func TestReadRules(t *testing.T) { title: "nil input", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer(nil) }, isStrict: false, @@ -59,7 +59,7 @@ func TestReadRules(t *testing.T) { title: "nil input", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer(nil) }, isStrict: true, @@ -68,7 +68,7 @@ func TestReadRules(t *testing.T) { title: "empty input", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(" ")) }, isStrict: false, @@ -77,7 +77,7 @@ func TestReadRules(t *testing.T) { title: "empty input", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(" ")) }, isStrict: true, @@ -86,7 +86,7 @@ func TestReadRules(t *testing.T) { title: "reader error", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return failingReader{ err: io.ErrClosedPipe, } @@ -98,7 +98,7 @@ func TestReadRules(t *testing.T) { title: "reader error", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return failingReader{ err: io.ErrClosedPipe, } @@ -110,7 +110,7 @@ func TestReadRules(t *testing.T) { title: "no rules, just a comment", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte("\n\n # pint file/disable xxx \n\n")) }, isStrict: false, @@ -119,7 +119,7 @@ func TestReadRules(t *testing.T) { title: "file/disable comment", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(` # pint file/disable promql/series @@ -143,7 +143,7 @@ func TestReadRules(t *testing.T) { title: "file/disable comment", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(` # pint file/disable promql/series @@ -170,7 +170,7 @@ groups: title: "single expired snooze comment", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(` # pint file/snooze 2000-01-01T00:00:00Z promql/series @@ -193,7 +193,7 @@ groups: title: "single expired snooze comment", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(` # pint file/snooze 2000-01-01T00:00:00Z promql/series @@ -219,7 +219,7 @@ groups: title: "single valid snooze comment", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(` # pint file/snooze 2099-01-01T00:00:00Z promql/series @@ -243,7 +243,7 @@ groups: title: "single valid snooze comment", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(` # pint file/snooze 2099-01-01T00:00:00Z promql/series @@ -270,7 +270,7 @@ groups: title: "ignore/file", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(` # pint ignore/file @@ -293,7 +293,7 @@ groups: title: "ignore/file", reportedPath: "rules.yml", sourcePath: "rules.yml", - sourceFunc: func(t *testing.T) io.Reader { + sourceFunc: func(_ *testing.T) io.Reader { return bytes.NewBuffer([]byte(` # pint ignore/file diff --git a/internal/discovery/git_branch_test.go b/internal/discovery/git_branch_test.go index eea6fe96..1cb7acc5 100644 --- a/internal/discovery/git_branch_test.go +++ b/internal/discovery/git_branch_test.go @@ -70,7 +70,7 @@ func TestGitBranchFinder(t *testing.T) { testCases := []testCaseT{ { title: "git list PR commits error - main", - setup: func(t *testing.T) {}, + setup: func(_ *testing.T) {}, finder: discovery.NewGitBranchFinder( func(args ...string) ([]byte, error) { return nil, fmt.Errorf("mock git error: %v", args) @@ -84,7 +84,7 @@ func TestGitBranchFinder(t *testing.T) { }, { title: "git list PR commits error - master", - setup: func(t *testing.T) {}, + setup: func(_ *testing.T) {}, finder: discovery.NewGitBranchFinder( func(args ...string) ([]byte, error) { return nil, fmt.Errorf("mock git error: %v", args) @@ -98,7 +98,7 @@ func TestGitBranchFinder(t *testing.T) { }, { title: "too many commits", - setup: func(t *testing.T) {}, + setup: func(_ *testing.T) {}, finder: discovery.NewGitBranchFinder( func(args ...string) ([]byte, error) { switch strings.Join(args, " ") { @@ -117,7 +117,7 @@ func TestGitBranchFinder(t *testing.T) { }, { title: "git list modified files error", - setup: func(t *testing.T) {}, + setup: func(_ *testing.T) {}, finder: discovery.NewGitBranchFinder( func(args ...string) ([]byte, error) { switch strings.Join(args, " ") { @@ -136,7 +136,7 @@ func TestGitBranchFinder(t *testing.T) { }, { title: "git get commit message error", - setup: func(t *testing.T) {}, + setup: func(_ *testing.T) {}, finder: discovery.NewGitBranchFinder( func(args ...string) ([]byte, error) { switch strings.Join(args, " ") { @@ -157,7 +157,7 @@ func TestGitBranchFinder(t *testing.T) { }, { title: "git blame error", - setup: func(t *testing.T) {}, + setup: func(_ *testing.T) {}, finder: discovery.NewGitBranchFinder( func(args ...string) ([]byte, error) { switch strings.Join(args, " ") { diff --git a/internal/git/changes_test.go b/internal/git/changes_test.go index 5ef92ca7..2bb8deee 100644 --- a/internal/git/changes_test.go +++ b/internal/git/changes_test.go @@ -49,7 +49,7 @@ func TestChanges(t *testing.T) { testCases := []testCaseT{ { title: "git log error", - setup: func(t *testing.T) (git.CommandRunner, git.CommitRangeResults) { + setup: func(_ *testing.T) (git.CommandRunner, git.CommitRangeResults) { cmd := func(args ...string) ([]byte, error) { return nil, fmt.Errorf("mock git error: %v", args) } diff --git a/internal/git/git_test.go b/internal/git/git_test.go index 72186af2..8e0d7bbd 100644 --- a/internal/git/git_test.go +++ b/internal/git/git_test.go @@ -40,20 +40,20 @@ func TestGitBlame(t *testing.T) { testCases := []testCaseT{ { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return nil, nil }, path: "foo.txt", output: nil, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return nil, errors.New("mock error") }, shouldError: true, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { content := blameLine("b33a88cea35abc47f9973983626e1c6f3f3abc44", 1, "foo.txt", "") return []byte(content), nil }, @@ -67,7 +67,7 @@ func TestGitBlame(t *testing.T) { }, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { content := blameLine("b33a88cea35abc47f9973983626e1c6f3f3abc44", 1, "foo.txt", "") + blameLine("b33a88cea35abc47f9973983626e1c6f3f3abc44", 2, "foo.txt", "") + blameLine("82987dec74ba8e434ba393d83491ace784473291", 3, "foo.txt", "") + @@ -111,21 +111,21 @@ func TestCommitRange(t *testing.T) { testCases := []testCaseT{ { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return nil, fmt.Errorf("mock error") }, output: git.CommitRangeResults{Commits: []string{}}, shouldError: true, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte(""), nil }, output: git.CommitRangeResults{Commits: []string{}}, shouldError: true, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte("commit1\n"), nil }, output: git.CommitRangeResults{ @@ -135,7 +135,7 @@ func TestCommitRange(t *testing.T) { }, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte("commit1\ncommit2\ncommit3\n"), nil }, output: git.CommitRangeResults{ @@ -145,7 +145,7 @@ func TestCommitRange(t *testing.T) { }, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte("commit2\ncommit1"), nil }, output: git.CommitRangeResults{ @@ -155,7 +155,7 @@ func TestCommitRange(t *testing.T) { }, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte("commit2\ncommit1\n"), nil }, output: git.CommitRangeResults{ @@ -190,27 +190,27 @@ func TestCurrentBranch(t *testing.T) { testCases := []testCaseT{ { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return nil, fmt.Errorf("mock error") }, output: "", shouldError: true, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte(""), nil }, output: "", shouldError: false, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte("foo"), nil }, output: "foo", }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte("foo bar\n"), nil }, output: "foo bar", @@ -272,27 +272,27 @@ func TestCommitMessage(t *testing.T) { testCases := []testCaseT{ { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return nil, fmt.Errorf("mock error") }, output: "", shouldError: true, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte(""), nil }, output: "", shouldError: false, }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte("foo"), nil }, output: "foo", }, { - mock: func(args ...string) ([]byte, error) { + mock: func(_ ...string) ([]byte, error) { return []byte("foo bar\n"), nil }, output: "foo bar\n", diff --git a/internal/promapi/config.go b/internal/promapi/config.go index e0789e1d..52da354d 100644 --- a/internal/promapi/config.go +++ b/internal/promapi/config.go @@ -115,17 +115,17 @@ func streamConfig(r io.Reader) (cfg PrometheusConfig, err error) { var yamlBody, status, errType, errText string decoder := current.Object( - current.Key("status", current.Value(func(s string, isNil bool) { + current.Key("status", current.Value(func(s string, _ bool) { status = s })), - current.Key("error", current.Value(func(s string, isNil bool) { + current.Key("error", current.Value(func(s string, _ bool) { errText = s })), - current.Key("errorType", current.Value(func(s string, isNil bool) { + current.Key("errorType", current.Value(func(s string, _ bool) { errType = s })), current.Key("data", current.Object( - current.Key("yaml", current.Value(func(s string, isNil bool) { + current.Key("yaml", current.Value(func(s string, _ bool) { yamlBody = s })), )), diff --git a/internal/promapi/errors.go b/internal/promapi/errors.go index 03b8a608..d0e9e2d5 100644 --- a/internal/promapi/errors.go +++ b/internal/promapi/errors.go @@ -107,13 +107,13 @@ func tryDecodingAPIError(resp *http.Response) error { var status, errType, errText string decoder := current.Object( - current.Key("status", current.Value(func(s string, isNil bool) { + current.Key("status", current.Value(func(s string, _ bool) { status = s })), - current.Key("error", current.Value(func(s string, isNil bool) { + current.Key("error", current.Value(func(s string, _ bool) { errText = s })), - current.Key("errorType", current.Value(func(s string, isNil bool) { + current.Key("errorType", current.Value(func(s string, _ bool) { errType = s })), ) diff --git a/internal/promapi/flags.go b/internal/promapi/flags.go index fffe9d2c..03a69895 100644 --- a/internal/promapi/flags.go +++ b/internal/promapi/flags.go @@ -101,13 +101,13 @@ func streamFlags(r io.Reader) (flags v1.FlagsResult, err error) { var status, errType, errText string flags = v1.FlagsResult{} decoder := current.Object( - current.Key("status", current.Value(func(s string, isNil bool) { + current.Key("status", current.Value(func(s string, _ bool) { status = s })), - current.Key("error", current.Value(func(s string, isNil bool) { + current.Key("error", current.Value(func(s string, _ bool) { errText = s })), - current.Key("errorType", current.Value(func(s string, isNil bool) { + current.Key("errorType", current.Value(func(s string, _ bool) { errType = s })), current.Key("data", current.Map(func(k, v string) { diff --git a/internal/promapi/metadata.go b/internal/promapi/metadata.go index ae10ff4b..a3daa882 100644 --- a/internal/promapi/metadata.go +++ b/internal/promapi/metadata.go @@ -107,13 +107,13 @@ func streamMetadata(r io.Reader) (meta map[string][]v1.Metadata, err error) { var status, errType, errText string meta = map[string][]v1.Metadata{} decoder := current.Object( - current.Key("status", current.Value(func(s string, isNil bool) { + current.Key("status", current.Value(func(s string, _ bool) { status = s })), - current.Key("error", current.Value(func(s string, isNil bool) { + current.Key("error", current.Value(func(s string, _ bool) { errText = s })), - current.Key("errorType", current.Value(func(s string, isNil bool) { + current.Key("errorType", current.Value(func(s string, _ bool) { errType = s })), current.Key("data", current.Map(func(k string, v []v1.Metadata) { diff --git a/internal/promapi/query.go b/internal/promapi/query.go index cea76b3f..c57b4074 100644 --- a/internal/promapi/query.go +++ b/internal/promapi/query.go @@ -120,17 +120,17 @@ func streamSamples(r io.Reader) (samples []Sample, stats QueryStats, err error) samples = []Sample{} var sample model.Sample decoder := current.Object( - current.Key("status", current.Value(func(s string, isNil bool) { + current.Key("status", current.Value(func(s string, _ bool) { status = s })), - current.Key("error", current.Value(func(s string, isNil bool) { + current.Key("error", current.Value(func(s string, _ bool) { errText = s })), - current.Key("errorType", current.Value(func(s string, isNil bool) { + current.Key("errorType", current.Value(func(s string, _ bool) { errType = s })), current.Key("data", current.Object( - current.Key("resultType", current.Value(func(s string, isNil bool) { + current.Key("resultType", current.Value(func(s string, _ bool) { resultType = s })), current.Key("result", current.Array( @@ -145,30 +145,30 @@ func streamSamples(r io.Reader) (samples []Sample, stats QueryStats, err error) )), current.Key("stats", current.Object( current.Key("timings", current.Object( - current.Key("evalTotalTime", current.Value(func(v float64, isNil bool) { + current.Key("evalTotalTime", current.Value(func(v float64, _ bool) { stats.Timings.EvalTotalTime = v })), - current.Key("resultSortTime", current.Value(func(v float64, isNil bool) { + current.Key("resultSortTime", current.Value(func(v float64, _ bool) { stats.Timings.ResultSortTime = v })), - current.Key("queryPreparationTime", current.Value(func(v float64, isNil bool) { + current.Key("queryPreparationTime", current.Value(func(v float64, _ bool) { stats.Timings.QueryPreparationTime = v })), - current.Key("innerEvalTime", current.Value(func(v float64, isNil bool) { + current.Key("innerEvalTime", current.Value(func(v float64, _ bool) { stats.Timings.InnerEvalTime = v })), - current.Key("execQueueTime", current.Value(func(v float64, isNil bool) { + current.Key("execQueueTime", current.Value(func(v float64, _ bool) { stats.Timings.ExecQueueTime = v })), - current.Key("execTotalTime", current.Value(func(v float64, isNil bool) { + current.Key("execTotalTime", current.Value(func(v float64, _ bool) { stats.Timings.ExecTotalTime = v })), )), current.Key("samples", current.Object( - current.Key("totalQueryableSamples", current.Value(func(v float64, isNil bool) { + current.Key("totalQueryableSamples", current.Value(func(v float64, _ bool) { stats.Samples.TotalQueryableSamples = int(math.Round(v)) })), - current.Key("peakSamples", current.Value(func(v float64, isNil bool) { + current.Key("peakSamples", current.Value(func(v float64, _ bool) { stats.Samples.PeakSamples = int(math.Round(v)) })), )), diff --git a/internal/promapi/range.go b/internal/promapi/range.go index 1e9a501a..319fed4a 100644 --- a/internal/promapi/range.go +++ b/internal/promapi/range.go @@ -284,17 +284,17 @@ func streamSampleStream(r io.Reader, step time.Duration) (dst MetricTimeRanges, var status, errType, errText, resultType string var sample model.SampleStream decoder := current.Object( - current.Key("status", current.Value(func(s string, isNil bool) { + current.Key("status", current.Value(func(s string, _ bool) { status = s })), - current.Key("error", current.Value(func(s string, isNil bool) { + current.Key("error", current.Value(func(s string, _ bool) { errText = s })), - current.Key("errorType", current.Value(func(s string, isNil bool) { + current.Key("errorType", current.Value(func(s string, _ bool) { errType = s })), current.Key("data", current.Object( - current.Key("resultType", current.Value(func(s string, isNil bool) { + current.Key("resultType", current.Value(func(s string, _ bool) { resultType = s })), current.Key("result", current.Array( @@ -308,30 +308,30 @@ func streamSampleStream(r io.Reader, step time.Duration) (dst MetricTimeRanges, )), current.Key("stats", current.Object( current.Key("timings", current.Object( - current.Key("evalTotalTime", current.Value(func(v float64, isNil bool) { + current.Key("evalTotalTime", current.Value(func(v float64, _ bool) { stats.Timings.EvalTotalTime = v })), - current.Key("resultSortTime", current.Value(func(v float64, isNil bool) { + current.Key("resultSortTime", current.Value(func(v float64, _ bool) { stats.Timings.ResultSortTime = v })), - current.Key("queryPreparationTime", current.Value(func(v float64, isNil bool) { + current.Key("queryPreparationTime", current.Value(func(v float64, _ bool) { stats.Timings.QueryPreparationTime = v })), - current.Key("innerEvalTime", current.Value(func(v float64, isNil bool) { + current.Key("innerEvalTime", current.Value(func(v float64, _ bool) { stats.Timings.InnerEvalTime = v })), - current.Key("execQueueTime", current.Value(func(v float64, isNil bool) { + current.Key("execQueueTime", current.Value(func(v float64, _ bool) { stats.Timings.ExecQueueTime = v })), - current.Key("execTotalTime", current.Value(func(v float64, isNil bool) { + current.Key("execTotalTime", current.Value(func(v float64, _ bool) { stats.Timings.ExecTotalTime = v })), )), current.Key("samples", current.Object( - current.Key("totalQueryableSamples", current.Value(func(v float64, isNil bool) { + current.Key("totalQueryableSamples", current.Value(func(v float64, _ bool) { stats.Samples.TotalQueryableSamples = int(math.Round(v)) })), - current.Key("peakSamples", current.Value(func(v float64, isNil bool) { + current.Key("peakSamples", current.Value(func(v float64, _ bool) { stats.Samples.PeakSamples = int(math.Round(v)) })), )), diff --git a/internal/reporter/bitbucket_test.go b/internal/reporter/bitbucket_test.go index 7d08555c..f7d4baef 100644 --- a/internal/reporter/bitbucket_test.go +++ b/internal/reporter/bitbucket_test.go @@ -120,7 +120,7 @@ func TestBitBucketReporter(t *testing.T) { Problem: checks.Problem{}, }, }, - httpHandler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + httpHandler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(400) _, _ = w.Write([]byte("Bad Request")) }), @@ -144,7 +144,7 @@ func TestBitBucketReporter(t *testing.T) { Problem: checks.Problem{}, }, }, - httpHandler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + httpHandler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { time.Sleep(time.Second * 2) w.WriteHeader(400) _, _ = w.Write([]byte("Bad Request")) @@ -169,7 +169,7 @@ func TestBitBucketReporter(t *testing.T) { Problem: checks.Problem{}, }, }, - httpHandler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + httpHandler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(400) time.Sleep(time.Second * 2) _, _ = w.Write([]byte("Bad Request")) diff --git a/internal/reporter/github_test.go b/internal/reporter/github_test.go index 65636377..9ca650d1 100644 --- a/internal/reporter/github_test.go +++ b/internal/reporter/github_test.go @@ -54,7 +54,7 @@ filename %s repo: "bar", token: "something", prNum: 123, - httpHandler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + httpHandler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { time.Sleep(1 * time.Second) _, _ = w.Write([]byte("OK")) }), diff --git a/tools/golangci-lint/go.mod b/tools/golangci-lint/go.mod index ed6c6563..522eb42b 100644 --- a/tools/golangci-lint/go.mod +++ b/tools/golangci-lint/go.mod @@ -2,7 +2,7 @@ module _ go 1.21.4 -require github.com/golangci/golangci-lint v1.56.0 +require github.com/golangci/golangci-lint v1.56.2 require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect @@ -11,7 +11,7 @@ require ( github.com/Abirdcfly/dupword v0.0.13 // indirect github.com/Antonboom/errname v0.1.12 // indirect github.com/Antonboom/nilnil v0.1.7 // indirect - github.com/Antonboom/testifylint v1.1.0 // indirect + github.com/Antonboom/testifylint v1.1.2 // indirect github.com/BurntSushi/toml v1.3.2 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 // indirect @@ -26,13 +26,13 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bkielbasa/cyclop v1.2.1 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v4 v4.2.0 // indirect + github.com/bombsimon/wsl/v4 v4.2.1 // indirect github.com/breml/bidichk v0.2.7 // indirect github.com/breml/errchkjson v0.3.6 // indirect github.com/butuzov/ireturn v0.3.0 // indirect github.com/butuzov/mirror v1.1.0 // indirect github.com/catenacyber/perfsprint v0.6.0 // indirect - github.com/ccojocar/zxcvbn-go v1.0.1 // indirect + github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect @@ -48,10 +48,10 @@ require ( github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/ghostiam/protogetter v0.3.4 // indirect - github.com/go-critic/go-critic v0.11.0 // indirect + github.com/go-critic/go-critic v0.11.1 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect - github.com/go-toolsmith/astequal v1.1.0 // indirect + github.com/go-toolsmith/astequal v1.2.0 // indirect github.com/go-toolsmith/astfmt v1.1.0 // indirect github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect @@ -85,7 +85,7 @@ require ( github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect github.com/jjti/go-spancheck v0.5.2 // indirect github.com/julz/importas v0.1.0 // indirect - github.com/kisielk/errcheck v1.6.3 // indirect + github.com/kisielk/errcheck v1.7.0 // indirect github.com/kisielk/gotool v1.0.0 // indirect github.com/kkHAIKE/contextcheck v1.1.4 // indirect github.com/kulti/thelper v0.6.3 // indirect @@ -105,7 +105,7 @@ require ( github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/revive v1.3.6 // indirect + github.com/mgechev/revive v1.3.7 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moricho/tparallel v0.3.1 // indirect @@ -131,8 +131,8 @@ require ( github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect - github.com/securego/gosec/v2 v2.18.2 // indirect + github.com/sashamelentyev/usestdlibvars v1.25.0 // indirect + github.com/securego/gosec/v2 v2.19.0 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect @@ -173,11 +173,11 @@ require ( go.uber.org/zap v1.24.0 // indirect golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect golang.org/x/exp/typeparams v0.0.0-20231219180239-dc181d75b848 // indirect - golang.org/x/mod v0.14.0 // indirect + golang.org/x/mod v0.15.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.17.0 // indirect + golang.org/x/tools v0.18.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/tools/golangci-lint/go.sum b/tools/golangci-lint/go.sum index 8b950f0d..d83dbc48 100644 --- a/tools/golangci-lint/go.sum +++ b/tools/golangci-lint/go.sum @@ -43,8 +43,8 @@ github.com/Antonboom/errname v0.1.12 h1:oh9ak2zUtsLp5oaEd/erjB4GPu9w19NyoIskZClD github.com/Antonboom/errname v0.1.12/go.mod h1:bK7todrzvlaZoQagP1orKzWXv59X/x0W0Io2XT1Ssro= github.com/Antonboom/nilnil v0.1.7 h1:ofgL+BA7vlA1K2wNQOsHzLJ2Pw5B5DpWRLdDAVvvTow= github.com/Antonboom/nilnil v0.1.7/go.mod h1:TP+ScQWVEq0eSIxqU8CbdT5DFWoHp0MbP+KMUO1BKYQ= -github.com/Antonboom/testifylint v1.1.0 h1:HrgwOEqVQc5eAsWEDA6JvK7ZSzfdTBjWt0PAYHweu+o= -github.com/Antonboom/testifylint v1.1.0/go.mod h1:m62Du5rtu7uwrWsypuLPTVeKbTB3NZgPWrxfffu2r/8= +github.com/Antonboom/testifylint v1.1.2 h1:IdLRermiLRogxY5AumBL4sP0A+qKHQM/AP1Xd7XOTKc= +github.com/Antonboom/testifylint v1.1.2/go.mod h1:9PFi+vWa8zzl4/B/kqmFJcw85ZUv8ReyBzuQCd30+WI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= @@ -88,8 +88,8 @@ github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJ github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= -github.com/bombsimon/wsl/v4 v4.2.0 h1:dKK3o/Hk2aIt6t72CWg02ham2P5lnH9MBSW6cTU9xxU= -github.com/bombsimon/wsl/v4 v4.2.0/go.mod h1:1zaTbf/7ywOQtMdoUdTF2X1fbbBLiBUkajyuFAanT28= +github.com/bombsimon/wsl/v4 v4.2.1 h1:Cxg6u+XDWff75SIFFmNsqnIOgob+Q9hG6y/ioKbRFiM= +github.com/bombsimon/wsl/v4 v4.2.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= @@ -100,8 +100,8 @@ github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= github.com/catenacyber/perfsprint v0.6.0 h1:VSv95RRkk5+BxrU/YTPcnxuMEWar1iMK5Vyh3fWcBfs= github.com/catenacyber/perfsprint v0.6.0/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= -github.com/ccojocar/zxcvbn-go v1.0.1 h1:+sxrANSCj6CdadkcMnvde/GWU1vZiiXRbqYSCalV4/4= -github.com/ccojocar/zxcvbn-go v1.0.1/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= +github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= +github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -147,8 +147,8 @@ github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/ghostiam/protogetter v0.3.4 h1:5SZ+lZSNmNkSbGVSF9hUHhv/b7ELF9Rwchoq7btYo6c= github.com/ghostiam/protogetter v0.3.4/go.mod h1:A0JgIhs0fgVnotGinjQiKaFVG3waItLJNwPmcMzDnvk= -github.com/go-critic/go-critic v0.11.0 h1:mARtIFX7jPtJ3SzxO9Isa5T2jd2dZxFmQHK3yNf0wrE= -github.com/go-critic/go-critic v0.11.0/go.mod h1:Cz6lr1PlkIu/0Y0U9KqJgcIJJECAF8mEwmzVjKnhbfI= +github.com/go-critic/go-critic v0.11.1 h1:/zBseUSUMytnRqxjlsYNbDDxpu3R2yH8oLXo/FOE8b8= +github.com/go-critic/go-critic v0.11.1/go.mod h1:aZVQR7+gazH6aDEQx4356SD7d8ez8MipYjXbEl5JAKA= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -158,8 +158,8 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= @@ -168,8 +168,9 @@ github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4 github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= -github.com/go-toolsmith/astequal v1.1.0 h1:kHKm1AWqClYn15R0K1KKE4RG614D46n+nqUQ06E1dTw= github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= +github.com/go-toolsmith/astequal v1.2.0 h1:3Fs3CYZ1k9Vo4FzFhwwewC3CHISHDnVUPC4x0bI2+Cw= +github.com/go-toolsmith/astequal v1.2.0/go.mod h1:c8NZ3+kSFtFY/8lPso4v8LuJjdJiUFVnSuU3s0qrrDY= github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlNMV634mhwuQ4= github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= @@ -227,8 +228,8 @@ github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6 github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g= github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= -github.com/golangci/golangci-lint v1.56.0 h1:uivqYQ8WbkWAE4LgjLLhxsTyb68FlcZF3ZIF0oyn4WQ= -github.com/golangci/golangci-lint v1.56.0/go.mod h1:ZqfKpUUZ+i4MTGqc3G5t18U+5cyXuMeWabXtdL38+Dk= +github.com/golangci/golangci-lint v1.56.2 h1:dgQzlWHgNbCqJjuxRJhFEnHDVrrjuTGQHJ3RIZMpp/o= +github.com/golangci/golangci-lint v1.56.2/go.mod h1:7CfNO675+EY7j84jihO4iAqDQ80s3HCjcc5M6B7SlZQ= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= @@ -315,8 +316,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= -github.com/kisielk/errcheck v1.6.3 h1:dEKh+GLHcWm2oN34nMvDzn1sqI0i0WxPvrgiJA5JuM8= -github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= +github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= +github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkHAIKE/contextcheck v1.1.4 h1:B6zAaLhOEEcjvUgIYEqystmnFk1Oemn8bvJhbt0GMb8= @@ -368,8 +369,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgechev/revive v1.3.6 h1:ZNKZiHb/LciAqzwa/9HnwI8S/OJutYhMvaqgMT1Ylgo= -github.com/mgechev/revive v1.3.6/go.mod h1:75Je+5jKBgdgADNzGhsq7H5J6CmyXSzEk9eLOU4i8Pg= +github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE= +github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -395,10 +396,10 @@ github.com/nunnatsa/ginkgolinter v0.15.2 h1:N2ORxUxPU56R9gsfLIlVVvCv/V/VVou5qVI1 github.com/nunnatsa/ginkgolinter v0.15.2/go.mod h1:oYxE7dt1vZI8cK2rZOs3RgTaBN2vggkqnENmoJ8kVvc= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= -github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= -github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= +github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= @@ -460,10 +461,10 @@ github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/ github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= -github.com/sashamelentyev/usestdlibvars v1.24.0 h1:MKNzmXtGh5N0y74Z/CIaJh4GlB364l0K1RUT08WSWAc= -github.com/sashamelentyev/usestdlibvars v1.24.0/go.mod h1:9cYkq+gYJ+a5W2RPdhfaSCnTVUC1OQP/bSiiBhq3OZE= -github.com/securego/gosec/v2 v2.18.2 h1:DkDt3wCiOtAHf1XkiXZBhQ6m6mK/b9T/wD257R3/c+I= -github.com/securego/gosec/v2 v2.18.2/go.mod h1:xUuqSF6i0So56Y2wwohWAmB07EdBkUN6crbLlHwbyJs= +github.com/sashamelentyev/usestdlibvars v1.25.0 h1:IK8SI2QyFzy/2OD2PYnhy84dpfNo9qADrRt6LH8vSzU= +github.com/sashamelentyev/usestdlibvars v1.25.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= +github.com/securego/gosec/v2 v2.19.0 h1:gl5xMkOI0/E6Hxx0XCY2XujA3V7SNSefA8sC+3f1gnk= +github.com/securego/gosec/v2 v2.19.0/go.mod h1:hOkDcHz9J/XIgIlPDXalxjeVYsHxoWUc5zJSHxcB8YM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= @@ -627,8 +628,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -667,8 +668,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -744,8 +745,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -829,8 +830,8 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=