Skip to content

cmd/go: all pattern in per package flags is inaccurate in module mode #71318

Open
@matloob

Description

@matloob

all has a slightly different meaning in module mode than it does in GOPATH mode. In GOPATH mode, it's pretty much everything:

In GOPATH mode, "all" expands to all packages found in all the GOPATH trees.

But in module mode, "all"

expands to the set of "packages in the main module (or workspace modules) and their dependencies, including dependencies needed by tests of any of those"

according to go help packages.

We don't seem to handle this correctly when processing "all" in -coverpkg and the per package flags -asmflags, -gccgoflags, -gcflags, and -ldflags. The cmd/go/internal/load.MatchPackage function just matches every package for all.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions