Open hawkingrei opened 3 months ago
It runs with go1.23
Please provide
Same here. Does not look to be a problem with go 1.22.6 though. The given panics only appears when running go 1.23.0
staticcheck -debug.version
staticcheck 2024.1.1 (0.5.1)
Compiled with Go version: go1.23.0
Main module:
honnef.co/go/tools@v0.5.1 (sum: h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=)
Dependencies:
github.com/BurntSushi/toml@v1.4.1-0.20240526193622-a339e1f7089c (sum: h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=)
golang.org/x/exp/typeparams@v0.0.0-20231108232855-2478ac86f678 (sum: h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ=)
golang.org/x/mod@v0.17.0 (sum: h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=)
golang.org/x/sync@v0.7.0 (sum: h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=)
golang.org/x/tools@v0.21.1-0.20240531212143-b6235391adb3 (sum: h1:SHq4Rl+B7WvyM4XODon1LXtP7gcG49+7Jubt1gWWswY=)
go version
go version go1.23.0 darwin/arm64
go env
GO111MODULE=''
GOARCH='arm64'
GOBIN='/Users/esterfano.lopes/go/bin'
GOCACHE='/Users/esterfano.lopes/Library/Caches/go-build'
GOENV='/Users/esterfano.lopes/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/esterfano.lopes/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/esterfano.lopes/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/esterfano.lopes/sdk/go1.23.0'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/esterfano.lopes/sdk/go1.23.0/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.0'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/esterfano.lopes/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/esterfano.lopes/Development/motain/news/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/6d/_lcfw1qd03d822wbyxv7dj800000gq/T/go-build1989325247=/tmp/go-build -gno-record-gcc-switches -fno-common'
This seems to be happening because of the new *types.Alias
type.
By default, go/types now produces Alias type nodes for type aliases. This behavior can be controlled by the
GODEBUG
gotypesalias
flag. Its default has changed from 0 in Go 1.22 to 1 in Go 1.23.
You should be able to work around it by setting GODEBUG=gotypesalias=0
.
It'd also be useful to have a minimal reproducer for this problem, because Staticcheck 2024.1 is supposed to handle the new type.
https://tiprow.hawkingrei.com/view/gs/pingcapprow/pr-logs/pull/pingcap_tidb/51126/fast_test_tiprow/1823540729058693120