davecgh / go-spew

Implements a deep pretty printer for Go data structures to aid in debugging
ISC License
6.05k stars 364 forks source link

No longer go gettable with go 1.11 and `GO111MODULE=on` inside $GOPATH #93

Open zshift opened 5 years ago

zshift commented 5 years ago

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"
dmitshur commented 5 years ago

~~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.

dchapes commented 4 years ago

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