Skip to content

proposal: cmd/go: restrict or remove the -modfile flag #80179

Description

@matloob

cc @adonovan @seankhliao @golang/go-command

The -modfile flag was added to allow tools such as gopls to run the go command logic to make changes to a temporary version of a go.mod file so that those changes could be surfaced to the user and applied in the editor. But the flag is complicated to support and has overlap with overlays.

Ideally commands that modify go.mod (without -mod=mod being provided) (go mod tidy and go get) can output the file contents in a special mode for tools to use instead, and we could remove the -modfile flag.

If we can't remove it, I think we should restrict it to only the subcommands that need to be used by gopls to reduce the complexity we'd have to support in the go command.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions