Skip to content

cmd/go: suggest 'go get' for packages in the main module instead of missing external package paths #46806

Open
@bcmills

Description

@bcmills

In #45979 (comment), I noted that go get in a go 1.17 module adds its arguments as // indirect.

As an intentional consequence of #45965, we place the // indirect dependencies in a separate section of the go.mod file from the direct dependencies. That potentially makes these new actually-direct dependencies more difficult to spot.

If we saw the import of the missing package from within the main module to begin with, we would add it without the erroneous // indirect marking, and avoid the churn of moving it between sections. So I think we should suggest a command that does that, instead of suggesting go get on the specific missing package(s).

That would also help to eliminate some of the redundancy in the go get hints (#43653).

CC @jayconrod @matloob @stevetraut

Metadata

Metadata

Assignees

No one assigned

    Labels

    BadErrorMessageIssues related compiler error messages that should be better.GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.modules

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions