Open findleyr opened 2 weeks ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
This is confusing, I agree. The documentation should mention that the default GODEBUG settings are determined by the go version in either the go.work or go.mod with go.work taking priority.
Here's a code pointer to this behavior: https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/load/godebug.go;l=51;bpv=0;bpt=1
I'd like to work on this issue.
Change https://go.dev/cl/623416 mentions this issue: _content/blog: update GODEBUG documentation to clarify go.work behavior
We recently encountered this confusing scenario when working in the x/tools repository
Therefore, there's no way to have a go.work file for which both x/tools and x/tools/gopls tests pass. This is a problem in x/tools, because these tests also fail when run from a different main module that uses go1.23 (see #70082).
Nevertheless, go.dev/blog/compat says the following:
We should update that documentation to explain how godebug interacts with go.work files.
CC @timothy-king @matloob @samthanawalla