Skip to content

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

@adonovan

Description

@adonovan
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions