Skip to content

x/playground: Format button produces a spurious 'invalid module version' error for commit hashes in go.mod #32980

@bcmills

Description

@bcmills

go subcommands such as go mod tidy, go test, and go build automatically resolve invalid versions found in the go.mod file to valid ones.

However, the Playground's Format button does not; instead, it emits an error message like:

go.mod:5: invalid module version "1f3472d942ba824034fb77cab6a6cfc1bc8a2c3c": version must be of the form v1.2.3

This is probably due to calling out to a golang.org/x/mod library instead of running the go command directly. (See also #32955 (comment) and #32614.)

CC @toothrot @dmitshur @ysmolsky

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions