From c713bed4e3e617d95a608db31084ea339b2d0502 Mon Sep 17 00:00:00 2001 From: Ben Reedy Date: Sun, 12 May 2024 09:24:05 +1000 Subject: [PATCH] chore(ci): update golangci-lint to latest version Signed-off-by: Ben Reedy --- .github/workflows/lint.yml | 4 ++-- exporter.go | 4 ++-- pkg/wmi/wmi_test.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 02fea970..74874c66 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -98,9 +98,9 @@ jobs: go-version-file: 'go.mod' - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: v1.55.2 + version: v1.58 args: "--timeout=5m" # golangci-lint action doesn't always provide helpful output, so re-run without the action for diff --git a/exporter.go b/exporter.go index 37ae7892..38e48f90 100644 --- a/exporter.go +++ b/exporter.go @@ -180,14 +180,14 @@ func main() { mux := http.NewServeMux() mux.HandleFunc(*metricsPath, withConcurrencyLimit(*maxRequests, collectors.BuildServeHTTP(*disableExporterMetrics, *timeoutMargin))) - mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/health", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json") _, err := fmt.Fprintln(w, `{"status":"ok"}`) if err != nil { _ = level.Debug(logger).Log("msg", "Failed to write to stream", "err", err) } }) - mux.HandleFunc("/version", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/version", func(w http.ResponseWriter, _ *http.Request) { // we can't use "version" directly as it is a package, and not an object that // can be serialized. err := json.NewEncoder(w).Encode(prometheusVersion{ diff --git a/pkg/wmi/wmi_test.go b/pkg/wmi/wmi_test.go index dc07eacf..b6da7215 100644 --- a/pkg/wmi/wmi_test.go +++ b/pkg/wmi/wmi_test.go @@ -12,13 +12,13 @@ type fakeWmiClass struct { } var ( - mapQueryAll = func(src interface{}, class string, where string) string { + mapQueryAll = func(src interface{}, _ string, _ string) string { return QueryAll(src, log.NewNopLogger()) } - mapQueryAllWhere = func(src interface{}, class string, where string) string { + mapQueryAllWhere = func(src interface{}, _ string, where string) string { return QueryAllWhere(src, where, log.NewNopLogger()) } - mapQueryAllForClass = func(src interface{}, class string, where string) string { + mapQueryAllForClass = func(src interface{}, class string, _ string) string { return QueryAllForClass(src, class, log.NewNopLogger()) } mapQueryAllForClassWhere = func(src interface{}, class string, where string) string {