cmd/go/internal/list: ensure that cfg.BuildMod is initialized before reading it in 'go list -m'
The default value of cfg.BuildMod depends on the 'go' version in the go.mod file. The go.mod file is read and parsed, and its settings are applied, in modload.InitMod. As it turns out, modload.Enabled does not invoke InitMod, so cfg.BuildMod is not necessarily set even if modload.Enabled returns true. Updates #33848 Change-Id: I13a4dd80730528e6f1a5acc492fcfe07cb59d94e Reviewed-on: https://go-review.googlesource.com/c/go/+/202917 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Showing
Please register or sign in to comment