[go-nuts] why go get does not work outside a module?

2019-02-15 Thread Manlio Perillo
I have started to use go modules recently, and I have set GO111MODULE=on. It was unexpected to found that go get does not work outside a module. As an example: $ go get github.com/davecheney/godoc2md go: cannot determine module path for source directory /home/manlio (outside GOPATH, no import com

Re: [go-nuts] why go get does not work outside a module?

2019-02-15 Thread Tyler Compton
It sounds to me like you would want to set GO111MODULE to "auto". My understanding is that then "go get" will behave like it used to when run inside of the GOPATH or in a directory tree without a go.mod file. Here's a bit of information about it on the wiki: https://github.com/golang/go/wiki/Modul

Re: [go-nuts] why go get does not work outside a module?

2019-02-16 Thread Manlio Perillo
Well, the problem is that module aware go get will **still** download commands in GOBIN and **will** cache downloaded modules in GOPATH/pkg/mod. So I don't see a valid reason why it should not work outside a module. Thanks Manlio Perillo On Saturday, February 16, 2019 at 1:08:08 AM UTC+1, Tyler

Re: [go-nuts] why go get does not work outside a module?

2019-02-16 Thread thepudds1460
The good news is that this is addressed for 1.12: #24250 cmd/go: allow "go get" when outside a module in module mode https://github.com/golang/go/issues/24250 It would be worthwhile to try the 1.12 release candidate if you can: https://groups.google.com/forum/#!topic/golang-announce/r0R2ji

Re: [go-nuts] why go get does not work outside a module?

2019-02-16 Thread Manlio Perillo
Thanks. The comment about tools dependencies was very interesting. Other package managers, like pipenv for Python, have the concept of dev dependencies. Basically, required packages are divided in two groups: packages and dev-packages: https://pipenv.readthedocs.io/en/latest/basics/#example-pip