From 025553efd7a3103cb82067fd09503b32e599b579 Mon Sep 17 00:00:00 2001 From: King'ori Maina Date: Wed, 20 Nov 2024 11:45:11 +0200 Subject: [PATCH] Address linting errors --- .golangci.yml | 5 +++++ resque_exporter.go | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..1783997 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,5 @@ +linters: + disable-all: true + enable: + - govet + - revive diff --git a/resque_exporter.go b/resque_exporter.go index 992c9ce..a8887b9 100644 --- a/resque_exporter.go +++ b/resque_exporter.go @@ -350,8 +350,8 @@ func main() { reg.MustRegister(exporter) http.Handle(*metricPath, promhttp.HandlerFor(reg, promhttp.HandlerOpts{Registry: reg})) - http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(` + http.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { + _, err := w.Write([]byte(` Resque Exporter

Resque Exporter

@@ -359,6 +359,10 @@ func main() { `)) + + if err != nil { + log.Error(err) + } }) log.Infoln("Listening on", *listenAddress)