Skip to content

x/playground: formatting a modern go.mod file fails incorrectly with "invalid go version" #65891

@dmitshur

Description

@dmitshur

Consider a playground snippet that includes a go.mod file as if generated by go mod init play.ground using the latest stable version of Go: https://go.dev/play/p/ZtkN19wIOev.

Pressing the "Format" (not "Run") button fails with an incorrect error message:

go.mod:3: invalid go version '1.22.0': must match format 1.23

I suspect this might be fixed if x/playground is updated to a more recent version of x/mod. It's currently using v0.9.0.

(Most x/ repos get automatic monthly updates of x/ dependencies, but x/playground is currently skipped because of #24823. So fixing that might also indirectly fix this issue.)

Issues #32980 and #32614 are also related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixPendingIssues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions