Skip to content

Commit daafb25

Browse files
committed
_content/blog: update GODEBUG documentation to clarify go.work behavior
This change updates the documentation to explain how GODEBUG settings are configured based on the Go version specified in either the go.mod or go.work file, with go.work taking priority. This clarification helps developers understand the interaction of GODEBUG settings with different Go workspace configurations. Fixes golang/go#70083
1 parent fb8010e commit daafb25

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

_content/blog/compat.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,13 @@ For the remaining programs, the new approach is:
461461
`/godebug/non-default-behavior/http2client:events` counts the
462462
number of HTTP transports that the program has configured without HTTP/2 support.
463463

464-
4. A program’s GODEBUG settings are configured to match the Go version
465-
listed in the main package’s `go.mod` file.
466-
If your program’s `go.mod` file says `go 1.20` and you update to
467-
a Go 1.21 toolchain, any GODEBUG-controlled behaviors changed in
468-
Go 1.21 will retain their old Go 1.20 behavior until you change the
469-
`go.mod` to say `go 1.21`.
464+
4. A program’s GODEBUG settings are configured to match the Go version
465+
listed in either the main package's `go.mod` file or in a `go.work` file,
466+
with the `go.work` file taking priority if both are present.
467+
If your program's `go.mod` file says `go 1.20` (or the `go.work` file specifies `go 1.20`)
468+
and you update to a Go 1.21 toolchain, any GODEBUG-controlled behaviors
469+
changed in Go 1.21 will retain their old Go 1.20 behavior until you update
470+
the relevant `go.mod` or `go.work` file to say `go 1.21`.
470471

471472
5. A program can change individual GODEBUG settings by using `//go:debug` lines
472473
in package `main`.

0 commit comments

Comments
 (0)