Skip to content

Commit

Permalink
Fix lint errors (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino authored Aug 10, 2022
1 parent 1910957 commit f1ede59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion exporter/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Device struct {
}

func (e *Exporter) fetchDeviceData(ctx context.Context) ([]Device, error) {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

params := &devices.GetDevicesParams{
Expand Down
4 changes: 2 additions & 2 deletions exporter/device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestDevice_PingMetrics_connected(t *testing.T) {

actual := subject.PingMetrics()
if actual == nil {
t.Error("expected PingMetrics() to return somthing, got nil")
t.Fatal("expected PingMetrics() to return somthing, got nil")
}

comparePingMetrics(t, metricExpectation{
Expand All @@ -68,7 +68,7 @@ func TestDevice_PingMetrics_missingPackets(t *testing.T) {

actual := subject.PingMetrics()
if actual == nil {
t.Error("expected PingMetrics() to return somthing, got nil")
t.Fatal("expected PingMetrics() to return somthing, got nil")
}

comparePingMetrics(t, metricExpectation{
Expand Down
5 changes: 3 additions & 2 deletions internal/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ffddorf/unms-exporter/exporter"
"github.com/ffddorf/unms-exporter/internal/cli/config"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sirupsen/logrus"
)
Expand All @@ -21,8 +22,8 @@ type handler struct {
func New(logger logrus.FieldLogger, cfg *config.Config) (http.Handler, error) {
reg := prometheus.NewPedanticRegistry()
reg.MustRegister(
prometheus.NewBuildInfoCollector(),
prometheus.NewGoCollector(),
collectors.NewBuildInfoCollector(),
collectors.NewGoCollector(),
)

exporters := make(map[string]*exporter.Exporter)
Expand Down

0 comments on commit f1ede59

Please sign in to comment.