Skip to content

proposal: cmd/go: tool command should recognize a package pattern and match against declared tools #74732

@dolmen

Description

@dolmen

Proposal Details

Add support for package pattern in "go tool". If the argument to "go tool" is detected as a pattern, match the pattern against the declared tools in go.mod.

Rationale

go get -tool . works.
go run . works.
But go tool . doesn't work: go: no such tool "."

go tool . should work too, like go tool $(go list .)
go get -tool ./internal/mytool && go tool ./internal/mytool should work too, like go get -tool ./internal/mytool && go tool $(go list ./internal/mytool)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProposalToolProposalIssues describing a requested change to a Go tool or command-line program.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions