Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_content/blog: update GODEBUG documentation to clarify go.work behavior #301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions _content/blog/compat.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,13 @@ For the remaining programs, the new approach is:
`/godebug/non-default-behavior/http2client:events` counts the
number of HTTP transports that the program has configured without HTTP/2 support.

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

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