]> Cypherpunks repositories - gostls13.git/commit
cmd/go: redefine -coverpkg to be a pattern list
authorRuss Cox <rsc@golang.org>
Thu, 9 Nov 2017 15:29:23 +0000 (10:29 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 10 Nov 2017 18:39:10 +0000 (18:39 +0000)
commite33794fbc2067515c7546ab3b35fe229eeec2a0b
tree0b4bdcc260ebfacab3f4da69f212bd5d7ebf4eb3
parent283558e42b88a6afa39da6ad4ae87558dc053776
cmd/go: redefine -coverpkg to be a pattern list

If you run

go test -coverpkg=all fmt

one possible interpretation is that you want coverage for all the
packages involved in the fmt test, not all the packages in the world.
Because coverpkg was previously defined as a list of packages
to be loaded, however, it meant all packages in the world.

Now that the go command has a concept of package notation
being used as a matching filter instead of a direct enumeration,
apply that to -coverpkg, so that -coverpkg=all now has the
more useful filter interpretation.

Fixes #10271.
Fixes #21283.

Change-Id: Iddb77b21ba286d3dd65b62507af27e244865072d
Reviewed-on: https://go-review.googlesource.com/76876
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/cmd/go/alldocs.go
src/cmd/go/go_test.go
src/cmd/go/internal/load/flag.go
src/cmd/go/internal/load/search.go
src/cmd/go/internal/test/test.go
src/cmd/go/testdata/src/sleepybad/p.go [new file with mode: 0644]