Fix linter issues

Fix all new linter issues that are raised by golanglint-ci 1.56
This commit is contained in:
Nicholas Thompson
2024-02-19 20:08:46 +02:00
parent 86d865ce1b
commit fa6fc5fb34
3 changed files with 4 additions and 4 deletions

View File

@@ -65,7 +65,7 @@ func getOpts(config Config) *mqtt.ClientOptions {
opts.SetOnConnectHandler(func(mqtt.Client) { opts.SetOnConnectHandler(func(mqtt.Client) {
log.Info("Client connected to broker") log.Info("Client connected to broker")
}) })
opts.SetConnectionLostHandler(func(cli mqtt.Client, err error) { opts.SetConnectionLostHandler(func(_ mqtt.Client, err error) {
log.Errorf("Client connection to broker lost: %v", err) log.Errorf("Client connection to broker lost: %v", err)
}) })

View File

@@ -63,7 +63,7 @@ func NewMunin(mk2 mk2driver.Mk2) *Munin {
return m return m
} }
func (m *Munin) ServeMuninHTTP(rw http.ResponseWriter, r *http.Request) { func (m *Munin) ServeMuninHTTP(rw http.ResponseWriter, _ *http.Request) {
muninDat := <-m.muninResponse muninDat := <-m.muninResponse
if muninDat.timesUpdated == 0 { if muninDat.timesUpdated == 0 {
log.Error("No data returned") log.Error("No data returned")
@@ -103,7 +103,7 @@ func (m *Munin) ServeMuninHTTP(rw http.ResponseWriter, r *http.Request) {
} }
} }
func (m *Munin) ServeMuninConfigHTTP(rw http.ResponseWriter, r *http.Request) { func (m *Munin) ServeMuninConfigHTTP(rw http.ResponseWriter, _ *http.Request) {
output := muninConfig output := muninConfig
_, err := rw.Write([]byte(output)) _, err := rw.Write([]byte(output))
if err != nil { if err != nil {

View File

@@ -9,7 +9,7 @@ import (
"github.com/diebietse/invertergui/mk2driver" "github.com/diebietse/invertergui/mk2driver"
) )
func TestServer(t *testing.T) { func TestServer(_ *testing.T) {
mockMk2 := mk2driver.NewMk2Mock() mockMk2 := mk2driver.NewMk2Mock()
muninServer := NewMunin(mockMk2) muninServer := NewMunin(mockMk2)