gobin icon indicating copy to clipboard operation
gobin copied to clipboard

GOFLAGS affecting gobin 0.0.13

Open sagikazarmark opened this issue 5 years ago • 0 comments

As of gobin 0.0.13 (thanks to a bugfix as far as I can tell) a global GOFLAGS=-mod=readonly setting causes gobin to fail:

failed to run go list -find -json github.com/golang/protobuf/protoc-gen-go: exit status 1
go: updates to go.mod needed, disabled by -mod=readonly

Personally, I'm not a huge fan of the "tools.go pattern", I use gobin to download and build packages not providing prebuilt binaries (and I don't want to see them in go.mod)

In CI I tend to run Go in mod=read-only mode (using the global GOFLAGS env var), so that I can catch non-installed dependencies and ad them to the mod file.

With the above setup, gobin 0.0.13 only works if I manually override GOFLAGS.

sagikazarmark avatar Oct 11 '19 14:10 sagikazarmark