From e76bdbdd73bd2ac3400f46dc72fa8978e6d2a788 Mon Sep 17 00:00:00 2001 From: Steven Hartland Date: Fri, 23 Oct 2026 09:10:33 +0100 Subject: [PATCH] chore: update Go lint tooling --- .travis.yml | 2 +- statsd_test.go | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8670c48..2dfe6a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ go: - master install: - - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.6 + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v2.15.0/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v2.15.0 script: - go test -v -race -timeout=10s ./... diff --git a/statsd_test.go b/statsd_test.go index fc7ffe8..65849ad 100644 --- a/statsd_test.go +++ b/statsd_test.go @@ -4,7 +4,6 @@ import ( "bytes" "errors" "io" - "io/ioutil" "net" "sync" "testing" @@ -203,7 +202,9 @@ func TestOddTagsArgs(t *testing.T) { } }() - _, _ = New(TagsFormat(InfluxDB), Tags("tag1")) + oddTags := []string{"tag1"} + //nolint:staticcheck // The odd tag count is the behavior under test. + _, _ = New(TagsFormat(InfluxDB), Tags(oddTags...)) t.Fatal("A panic should occur") } @@ -519,14 +520,14 @@ func newServer(t testing.TB, network, addr string, f func([]byte)) *server { s.closed <- true return } - p, err := ioutil.ReadAll(conn) - if err != nil { + var p bytes.Buffer + if _, err := io.Copy(&p, conn); err != nil { t.Fatal(err) } if err := conn.Close(); err != nil { t.Fatal(err) } - f(p) + f(p.Bytes()) } }() default: