Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: confusing go.work version error message #66207

Closed
adonovan opened this issue Mar 8, 2024 · 2 comments
Closed

cmd/go: confusing go.work version error message #66207

adonovan opened this issue Mar 8, 2024 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@adonovan
Copy link
Member

adonovan commented Mar 8, 2024

foo$ cat go.work 
use .
foo$ cat go.mod
module foo
go 1.21
foo$ go list 
go: module . listed in go.work file requires go >= 1.21, but go.work lists go 1.18; to update it:
	go work use

This error message is confusing because the string "go1.18" is not present in the input; it is merely the oldest version of Go that supports go.work files.

It would be more helpful to say "go.work implicitly requires go1.18" when there is no go directive.

@mknyszek mknyszek added this to the Backlog milestone Mar 9, 2024
@mknyszek
Copy link
Contributor

mknyszek commented Mar 9, 2024

CC @matloob I think?

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 9, 2024
@gopherbot
Copy link

Change https://go.dev/cl/570735 mentions this issue: cmd/go: provide a better error message when there's no go directive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants