Skip to content

cmd/go: should 'go mod init' suggest (or run) 'go mod tidy'? #41712

@bcmills

Description

@bcmills

(This issue is a follow-on to #40728, based on a discussion with @dr2chase.)

Now that we're defaulting to -mod=readonly, users who create a module from existing source code will generally need to run go mod tidy before they can actually build the packages in the module.

  • Should go mod init check for source files and suggest that command?
  • Should go mod init go ahead and tidy the module itself? (We don't know whether the user intends to prune out some nested modules before tidying, but nested modules should be rare anyway.)

CC @jayconrod @matloob

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions