scross01 / prometheus-klipper-exporter

Prometheus Exporter for Klipper
MIT License
51 stars 11 forks source link

Fix lint warnings and errors #21

Closed hsmade closed 7 months ago

hsmade commented 7 months ago

While I was looking at the other issue, my IDE started notifying me that there were some issues with the code. I fixed those.

$ go vet .
# github.com/scross01/prometheus-klipper-exporter
./main.go:26:61: handler passes lock by value: github.com/sirupsen/logrus.Logger contains github.com/sirupsen/logrus.MutexWrap
./main.go:59:59: call of collector.New copies lock value: github.com/sirupsen/logrus.Logger contains github.com/sirupsen/logrus.MutexWrap
./main.go:87:17: call of handler copies lock value: github.com/sirupsen/logrus.Logger contains github.com/sirupsen/logrus.MutexWrap

I hope the changes in this PR are helpful. Please don't see them as nitpicking or critique on the code, I just can't stand my IDE yelling at me :)

scross01 commented 7 months ago

This is great, thanks for taking the time to improve the code.