diff --git a/filesystem.go b/filesystem.go index c8a2d385..fa0e0f71 100644 --- a/filesystem.go +++ b/filesystem.go @@ -122,7 +122,7 @@ func cmdFilesystem(logger log.Logger, reg *prometheus.Registry, promClient api.C } <-ctx.Done() return nil - }, func(err error) { + }, func(_ error) { cancel() }) } @@ -158,7 +158,7 @@ func cmdFilesystem(logger log.Logger, reg *prometheus.Registry, promClient api.C level.Warn(logger).Log("msg", "encountered file watcher error", "err", err) } } - }, func(err error) { + }, func(_ error) { _ = watcher.Close() cancel() }) @@ -195,7 +195,7 @@ func cmdFilesystem(logger log.Logger, reg *prometheus.Registry, promClient api.C reload <- struct{}{} // Trigger a Prometheus reload } } - }, func(err error) { + }, func(_ error) { cancel() }) } @@ -235,7 +235,7 @@ func cmdFilesystem(logger log.Logger, reg *prometheus.Registry, promClient api.C } } } - }, func(err error) { + }, func(_ error) { cancel() close(reload) }) @@ -260,7 +260,7 @@ func cmdFilesystem(logger log.Logger, reg *prometheus.Registry, promClient api.C gr.Add(func() error { level.Info(logger).Log("msg", "starting up HTTP API", "address", server.Addr) return server.ListenAndServe() - }, func(err error) { + }, func(_ error) { _ = server.Shutdown(context.Background()) }) } diff --git a/kubernetes.go b/kubernetes.go index 86835d44..0d75c7de 100644 --- a/kubernetes.go +++ b/kubernetes.go @@ -116,7 +116,7 @@ func cmdKubernetes( } setupLog.Info("starting manager") return mgr.Start(ctx) - }, func(err error) { + }, func(_ error) { cancel() }) } @@ -137,7 +137,7 @@ func cmdKubernetes( return server.ListenAndServeTLS(certFile, privateKeyFile) } return server.ListenAndServe() - }, func(err error) { + }, func(_ error) { shutdownCtx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() _ = server.Shutdown(shutdownCtx) diff --git a/main.go b/main.go index 69e5810a..23e1e028 100644 --- a/main.go +++ b/main.go @@ -299,7 +299,7 @@ func cmdAPI( } r.Handle("/metrics", promhttp.HandlerFor(reg, promhttp.HandlerOpts{})) - r.Get("/objectives", func(w http.ResponseWriter, r *http.Request) { + r.Get("/objectives", func(w http.ResponseWriter, _ *http.Request) { err := tmpl.Execute(w, struct { PrometheusURL string PathPrefix string