]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add support for godebug lines in go.mod and go.work
authorRuss Cox <rsc@golang.org>
Thu, 9 May 2024 00:41:38 +0000 (20:41 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 15 May 2024 13:52:10 +0000 (13:52 +0000)
commit6ccd8e4cf69efbc8983a9873a41158f554ea5363
treec27a6b85448a30ceba52cf471f1dedf31efd0188
parent0222a028f19d9f497cf407bcf07f3ec56a032bdb
cmd/go: add support for godebug lines in go.mod and go.work

The fact that the go line sets both the language version and the
GODEBUG compatibility version can be a problem, especially since
the go line is also required to be ≥ the go lines of any required
dependency modules.

This change adds a new 'godebug' line to go.mod and go.work
to allow setting the GODEBUG values for the entire module.

It also adds a new meta-value default=go1.21 that means
take the defaults from Go 1.21 no matter what the go line says.

These were discussed in proposal #65573.

Fixes #65573.

Change-Id: I91746322a10178370ed1015ce5278372a024c824
Reviewed-on: https://go-review.googlesource.com/c/go/+/584476
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
doc/godebug.md
src/cmd/go/alldocs.go
src/cmd/go/internal/load/godebug.go
src/cmd/go/internal/modcmd/edit.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/workcmd/edit.go
src/cmd/go/testdata/script/godebug_default.txt
src/cmd/go/testdata/script/mod_edit.txt
src/cmd/go/testdata/script/work_edit.txt