From daafb25fc9191a41392d5efcc954ab7b1e62f3cf Mon Sep 17 00:00:00 2001 From: chansuke Date: Thu, 31 Oct 2024 00:17:32 +0900 Subject: [PATCH] _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 --- _content/blog/compat.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/_content/blog/compat.md b/_content/blog/compat.md index 33549a0828..b50d266c93 100644 --- a/_content/blog/compat.md +++ b/_content/blog/compat.md @@ -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`.