Description
Go version
go 1.24.0
Output of go env
in your module/workspace:
go env
```shell AR='ar' CC='clang' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_ENABLED='1' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' CXX='clang++' GCCGO='gccgo' GO111MODULE='auto' GOARCH='arm64' GOARM64='v8.0' GOAUTH='netrc' GOBIN='' GOCACHE='/Users/pierre.gimalac/Library/Caches/go-build' GOCACHEPROG='' GODEBUG='' GOENV='/Users/pierre.gimalac/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFIPS140='off' GOFLAGS='' GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/zp/m8h1x16s30g3f656sxsdt7rm0000gp/T/go-build2391666502=/tmp/go-build -gno-record-gcc-switches -fno-common' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE='' GOMOD='/Users/pierre.gimalac/go/src/github.com/DataDog/datadog-agent-dev/go.mod' GOMODCACHE='/Users/pierre.gimalac/go/pkg/mod' GONOPROXY='github.com/DataDog' GONOSUMDB='github.com/DataDog,go.ddbuild.io' GOOS='darwin' GOPATH='/Users/pierre.gimalac/go' GOPRIVATE='github.com/DataDog' GOPROXY='binaries.ddbuild.io,proxy.golang.org,direct' GOROOT='/usr/local/go' GOSUMDB='sum.golang.org' GOTELEMETRY='local' GOTELEMETRYDIR='/Users/pierre.gimalac/Library/Application Support/go/telemetry' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64' GOVCS='' GOVERSION='go1.24.0' GOWORK='/Users/pierre.gimalac/go/src/github.com/DataDog/datadog-agent-dev/go.work' PKG_CONFIG='pkg-config' ```What did you do?
I'm working on a codebase with a go.work
file containing the following directives:
go 1.23.6
toolchain go1.23.6
godebug tlskyber=0
When using Go 1.23.x, everything works fine, but whenever I use 1.24.x go
errors due to tlskyber
not being a recognized setting.
Using godebug default=go1.23
didn't change anything.
I know the documentation https://go.dev/doc/godebug says:
It is an error to list a godebug with an unrecognized setting.
[...]
Starting in Go 1.21, the Go toolchain treats a //go:debug directive with an unrecognized GODEBUG setting as an invalid program.
But I was not expecting it to apply to settings which have been removed in previous versions.
Since my installed toolchain is more recent than the toolchain directive, it's not automatically downgrading to 1.23.6, despite the go.work
using a godebug
directive specific to go 1.23.
In practice this kind of seems like a breaking change, as something working with go 1.23 completely fails with 1.24... I feel like removed setting could be ignored, or warn without actually failing.
What did you see happen?
Any go
command fails with
go: error loading go.work:
go.work:9: unknown godebug "tlskyber"
What did you expect to see?
Either the toolchain should downgrade to 1.23.6, or maybe warn about the godebug
directive being deprecated and ignore it (without failing).