cmd/go: error text for missing package import becomes confusing after toolchain selection #61871
Labels
FrozenDueToAge
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tried building a Go program, while using GOTOOLCHAIN to select an older version of the Go toolchain (1.20.7 instead of 1.21.0), that should fail because it imports a package that doesn't exist in the Go standard library at that version:
(The real thing I was doing was using
GOTOOLCHAIN=<older toolchain> go test ./...
to check that my change that starts to use Go 1.21's new "slices" package in a build-constrained .go file didn't accidentally break with older supported Go releases too.)What did you expect to see?
An error message that mentions the name of the package. For example, something like:
Or more realistically, the less-improved error message as implemented in Go 1.20.7:
What did you see instead?
An error message that says "" instead of the package name or path:
CC @bcmills, @matloob, @rsc.
The text was updated successfully, but these errors were encountered: