From fbf78373879d4a582cf4be1239e40035b02436c3 Mon Sep 17 00:00:00 2001 From: Pedro Tanaka Date: Tue, 26 Apr 2022 21:07:02 +0200 Subject: [PATCH] Fixing linting problems on new code Signed-off-by: Pedro Tanaka --- pkg/relay/relay.go | 3 ++- pkg/relay/relay_test.go | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/relay/relay.go b/pkg/relay/relay.go index bdae527..6e8e752 100644 --- a/pkg/relay/relay.go +++ b/pkg/relay/relay.go @@ -16,11 +16,12 @@ package relay import ( "bytes" "fmt" - "github.com/prometheus/statsd_exporter/pkg/clock" "net" "strings" "time" + "github.com/prometheus/statsd_exporter/pkg/clock" + "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" diff --git a/pkg/relay/relay_test.go b/pkg/relay/relay_test.go index 5bdfbca..3974c9d 100644 --- a/pkg/relay/relay_test.go +++ b/pkg/relay/relay_test.go @@ -2,13 +2,14 @@ package relay import ( "fmt" + "testing" + "time" + "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" "github.com/prometheus/statsd_exporter/pkg/clock" "github.com/stvp/go-udp-testing" - "testing" - "time" ) func TestRelay_RelayLine(t *testing.T) { @@ -33,7 +34,6 @@ func TestRelay_RelayLine(t *testing.T) { for _, tt := range tests { udp.SetAddr(":1160") t.Run(tt.name, func(t *testing.T) { - tickerCh := make(chan time.Time) clock.ClockInstance = &clock.Clock{ TickerCh: tickerCh, @@ -56,8 +56,8 @@ func TestRelay_RelayLine(t *testing.T) { r.RelayLine(line) } // Tick time forward to trigger a packet send. - clock.ClockInstance.Instant = time.Unix(20000, 0) - clock.ClockInstance.TickerCh <- time.Unix(20000, 0) + clock.ClockInstance.Instant = time.Unix(1, 10) + clock.ClockInstance.TickerCh <- time.Unix(0, 0) }) metrics, err := prometheus.DefaultGatherer.Gather()