cmd/go: improve build list errors related to replace and exclude directives #35039
Labels
FrozenDueToAge
GoCommand
cmd/go
modules
NeedsFix
The path to resolution is known, but the work has not been done.
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?
What did you expect to see?
When we can't load a module version that was either replaced or excluded, we should print the file and line number in go.mod where the directive came from.
What did you see instead?
For an
exclude
directive, we print parens after the main module. It seems like a version would go here, but the main module is the only module whereexclude
directives are applied, and it never has a version, so these should be left out. The excluded module and version should use an@
instead of parens, consistent with other error messages.For a
replace
directive, we don't mention the fact that the module was replaced at all.The text was updated successfully, but these errors were encountered: