From 064953429947722c505009dcc9eef8082b800f0c Mon Sep 17 00:00:00 2001 From: Norbert Kwizera Date: Thu, 12 Oct 2023 17:01:10 +0200 Subject: [PATCH] Fix static checks issues --- librato.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/librato.go b/librato.go index ef071d6..b1a6b9f 100644 --- a/librato.go +++ b/librato.go @@ -60,8 +60,8 @@ func NewCollector(username string, token string, source string, timeout time.Dur // Start starts our librato sender, callers can use Stop to stop it func (c *collector) Start() { + c.waitGroup.Add(1) go func() { - c.waitGroup.Add(1) defer c.waitGroup.Done() slog.Info("started collector", "username", c.username, "comp", "librato") @@ -112,12 +112,13 @@ func (c *collector) flush(count int) { } // read up to our count of gauges +readCounts: for i := 0; i < count; i++ { select { case g := <-c.buffer: reqPayload.Gauges = append(reqPayload.Gauges, g) default: - break + break readCounts } }