You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go1.9.2 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
not revelent
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
go test -coverpkg ./... mypkg/anotherpkg
Where mypkg contains folders containing test only files
What did you expect to see?
PASS
coverage: 100% of statements...
What did you see instead?
go build mypkg/examples: no non-test Go files in ~/go/src/mypkg/examples
FAIL mypkg/anotherpkg [build failed]
The text was updated successfully, but these errors were encountered:
AlexRouSg
changed the title
cmd/go: coverpkg=./... not ignoreing folders with test only files
cmd/go: test coverpkg=./... not ignoreing folders with test only files
Jan 16, 2018
Saw that, but wasn't sure if it's the same issue as that concerns go vet and this concerns go test -coverpkg
odeke-em
changed the title
cmd/go: test coverpkg=./... not ignoreing folders with test only files
cmd/go: test coverpkg=./... not ignoring folders with test only files
Jan 16, 2018
I've since found a simple workaround in case anyone was wondering.
Simply make an empty .go file with the package declaration.
And that's enough to get coverpkg to continue on.
I would be fine with that for the short term, but this will get pretty annoying when you have a ton of test only folders.
Fixed in Go 1.10 because -coverpkg now takes a pattern filtering the list of packages already going into the test binary, not a pattern generating a list of packages.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.9.2 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?not revelent
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
go test -coverpkg ./... mypkg/anotherpkg
Where mypkg contains folders containing test only files
What did you expect to see?
PASS
coverage: 100% of statements...
What did you see instead?
go build mypkg/examples: no non-test Go files in ~/go/src/mypkg/examples
FAIL mypkg/anotherpkg [build failed]
The text was updated successfully, but these errors were encountered: