Weird SA1019 false positive with generic method and another deprecated
Author: maxatomeCreated Sep 8, 2026Updated Sep 8, 2026
Labelsbugfalse-positive
The output of 'staticcheck -version' →
staticcheck 2026.2.1 (0.8.1)- The output of 'staticcheck -debug.version' (it is fine if this command fails)
staticcheck 2026.2.1 (0.8.1) Compiled with Go version: go1.27.1 Main module: honnef.co/go/[email protected] (sum: h1:+JKf3xJ1ni4CwrhVg4/pqsfPGP6vNAXcKbMXJodYx3w=) Dependencies: github.com/BurntSushi/[email protected] (sum: h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=) golang.org/x/exp/[email protected] (sum: h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ=) golang.org/x/[email protected] (sum: h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM=) golang.org/x/[email protected] (sum: h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=) golang.org/x/[email protected] (sum: h1:vSv/HN1q9eoPD7lMyJYVJ/GPYnqtqu6adMxUmrxOB78=) The output of 'go version' →
go version go1.27.1 linux/amd64- The output of 'go env'
AR='ar' CC='gcc' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_ENABLED='1' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' CXX='g++' GCCGO='gccgo' GO111MODULE='' GOAMD64='v1' GOARCH='amd64' GOAUTH='netrc' GOBIN='/go/bin' GOCACHE='/root/.cache/go-build' GOCACHEPROG='' GODEBUG='' GOENV='/root/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFIPS140='off' GOFLAGS='' GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build151895466=/tmp/go-build -gno-record-gcc-switches' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMOD='/root/test/go.mod' GOMODCACHE='/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPACKAGESDRIVER='' GOPATH='/go' GOPRIVATE='' GOPROXY='https://proxy.golang.org,direct' GOROOT='/usr/local/go' GOSUMDB='sum.golang.org' GOTELEMETRY='local' GOTELEMETRYDIR='/root/.config/go/telemetry' GOTMPDIR='' GOTOOLCHAIN='local' GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.27.1' GOWORK='' PKG_CONFIG='pkg-config' Exactly which commands you ran (in a golang docker fresh image):
root@22a3c9086eb2:~# mkdir test
root@22a3c9086eb2:~# cd test
root@22a3c9086eb2:~/test# cat <<EOF > main_test.go
package main_test
import (
"testing"
"github.com/maxatome/go-testdeep/td"
)
type X struct {
A []byte
}
func TestX(t *testing.T) {
assert := td.Assert(t)
assert.Cmp(
X{A: []byte("pipo bingo")},
X{A: assert.AT[[]byte](td.Contains("bingo"))})
}
EOF
root@22a3c9086eb2:~/test# go mod init test/pipo
go: creating new go.mod: module test/pipo
go: to add module requirements and sums:
go mod tidy
root@22a3c9086eb2:~/test# go mod tidy
go: finding module for package github.com/maxatome/go-testdeep/td
go: downloading github.com/maxatome/go-testdeep v1.16.0
go: found github.com/maxatome/go-testdeep/td in github.com/maxatome/go-testdeep v1.16.0
root@22a3c9086eb2:~/test# go test .
ok test/pipo 0.002s
root@2b3057ad93ce:~/test# go install honnef.co/go/tools/cmd/[email protected]
go: downloading honnef.co/go/tools v0.8.1
go: downloading golang.org/x/tools v0.44.1-0.20260420230617-19499e7caabc
go: downloading golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678
go: downloading golang.org/x/sync v0.20.0
go: downloading github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c
go: downloading golang.org/x/mod v0.35.0
go: downloading golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
root@2b3057ad93ce:~/test# staticcheck -version
staticcheck 2026.2.1 (0.8.1)- Output of the command and what's wrong with the output:
root@2b3057ad93ce:~/test# staticcheck ./...
main_test.go:18:22: (*github.com/maxatome/go-testdeep/td.T).AT is deprecated: RunT has been superseded by [T.Run] method. It is kept for compatibility. (SA1019)(*github.com/maxatome/go-testdeep/td.T).AT is not deprecated but (*github.com/maxatome/go-testdeep/td.T).RunT is. However neither main_test.go nor T.AT use T.RunT, that is why it is weird…
Source: dominikh/go-tools