go-spew
go-spew copied to clipboard
No longer go gettable with go 1.11 and `GO111MODULE=on` inside $GOPATH
Repro steps
> echo $GO111MODULE
on
> pwd
(subdir of GOPATH)
> go get -u github.com/davecgh/go-spew/spew
go: finding github.com/davecgh/go-spew/spew latest
go get github.com/davecgh/go-spew/spew: no matching versions for query "latest"
~~I don't think you can use GO111MODULE=on
inside a GOPATH workspace, can you? I think
GO111MODULE=on
is allowed only outside of GOPATH, and GO111MODULE=off
or GO111MODULE=auto
are allowed inside.~~
Edit: Never mind, it seems valid to use GO111MODULE=on
inside a GOPATH workspace according to https://github.com/golang/go/wiki/Modules#how-to-define-a-module.
Works for me:
> pwd
[subdir of $GOPATH]
> go version
go version go1.14.3 freebsd/amd64
> go env GOMOD
[no output, e.g. no go.mod found]
> env GO111MODULE=on go env GOMOD
/dev/null
> env GO111MODULE=on go get -u github.com/davecgh/go-spew/spew
go: found github.com/davecgh/go-spew/spew in github.com/davecgh/go-spew v1.1.1