I am using modules with a vendor folder, when i try to run go tool cover it attempts to connect to the internet to download the dependencies.
What did you expect to see?
Cover to succeed without an internet connection
What did you see instead?
cover: cannot run go list: exit status 1
go: firstname.lastname@example.org: unrecognized import path "gopkg.in/src-d/go-git.v4" (https fetch: Get https://gopkg.in/src-d/go-git.v4?go-get=1: dial tcp: lookup gopkg.in on 192.168.65.1:53: no such host)
go: email@example.com+incompatible: unrecognized import path "k8s.io/client-go" (https fetch: Get https://k8s.io/client-go?go-get=1: dial tcp: lookup k8s.io on 192.168.65.1:53: no such host)
The text was updated successfully, but these errors were encountered:
Fwiw we had the same issue, and really we just weren't aware that the go tool cover invocation will use flags from GOFLAGS envvar, and expected an explicit -mod flag for the tool. Maybe something to clarify in -help?
Because go tool cover was calling go list without any arguments I was getting that error, being new to go I wasn't aware of the GOFLAGS env var could set global flags. I'm ok using GOFLAGS now but maybe you could consider adding the -mod flag to go tool since it calls other tools that may require it.