diff --git a/.golangci.toml b/.golangci.toml index fbaf99c..7256c2e 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -29,9 +29,6 @@ disable = [ # generally "exhaustruct", - # Not relevant after 1.22 - "exportloopref", - # We tried this linter but most places we do forced type asserts are # pretty safe, e.g., an atomic.Value when everything is encapsulated # in a small package. @@ -95,8 +92,8 @@ disable = [ # actually made it harder to read. "tagalign", - # We probably _should_ be doing this! - "thelper", + # Deprecated since golangci-lint 1.64.0. The usetesting linter replaces it. + "tenv", # We don't follow this. Sometimes we test internal code. "testpackage", diff --git a/mmdbtype/types_test.go b/mmdbtype/types_test.go index 2c5824e..8a8fcb1 100644 --- a/mmdbtype/types_test.go +++ b/mmdbtype/types_test.go @@ -450,6 +450,8 @@ func TestEqual(t *testing.T) { } func validateEncoding(t *testing.T, tests map[string]DataType) { + t.Helper() + for expected, dt := range tests { w := &dataWriter{Buffer: &bytes.Buffer{}} diff --git a/tree_test.go b/tree_test.go index d61dfb5..9165e1d 100644 --- a/tree_test.go +++ b/tree_test.go @@ -730,6 +730,8 @@ func TestTreeInsertAndGet(t *testing.T) { } func checkMMDB(t *testing.T, buf *bytes.Buffer, gets []testGet, name string) { + t.Helper() + t.Run(name, func(t *testing.T) { reader, err := maxminddb.FromBytes(buf.Bytes()) require.NoError(t, err) @@ -836,7 +838,7 @@ func TestGet_4ByteIPIn128BitTree(t *testing.T) { assert.Equal(t, network.String(), getNetwork.String(), "16-byte lookup") } -func s2ip(v string) *any { //nolint:gocritic // test +func s2ip(v string) *any { i := any(v) return &i }