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
/cc @jayconrod@bcmills This may be related to cmd/go or cmd/cover, but I'm not sure who owns the cover cool.
I don't see cmd/cover mentioned in #24661. We should add it there so it's easier to know whether it supports module mode.
dmitshur
changed the title
How to instructs the cover command to use the main module's top-level vendor directory to satisfy dependencies? It doesn't recognize -mod flag.
cmd/go: how to get the cover command to use the main module's top-level vendor directory to satisfy dependencies; it doesn't recognize -mod flag
Dec 2, 2019
jayconrod
changed the title
cmd/go: how to get the cover command to use the main module's top-level vendor directory to satisfy dependencies; it doesn't recognize -mod flag
cmd/cover: support -mod and other build flags
Dec 2, 2019
This is similar to #35200, but this is for cmd/cover instead of cmd/doc.
Both commands invoke the go list internally. Neither command provides a way to pass through build flags. We should at least support -mod.
@dtelyukh You can work around this in Go 1.13 by adding -mod=vendor to the GOFLAGS environment variable when invoking go tool cover. For example GOFLAGS=-mod=vendor go tool cover -html=../coverage.cov -o ../coverage.html.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, it does
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
GO_PATH/~/go/pkg/mod/ dir is empty
What did you expect to see?
After running the cover command GO_PATH/~/go/pkg/mod/ dir is still empty
What did you see instead?
After running the cover command GO_PATH/~/go/pkg/mod/ dir is not empty
The text was updated successfully, but these errors were encountered: