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 Compton wrote: > > 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/Modules#when-do-i-get-old-behavior-vs-new-module-based-behavior > > > On Fri, Feb 15, 2019 at 6:23 AM Manlio Perillo <manlio....@gmail.com > <javascript:>> wrote: > >> 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 comments) >> >> When I used go get inside a module I found that: >> >> 1. It saves the downloaded packages in the go mod cache >> 2. It Installs the command in GOBIN >> >> These two points can be also done outside a module. >> >> 3. Add an (indirect) entry in the require section in the go.mod file >> >> The new entry will, however, be removed by go mod tidy. >> >> Is it really necessary that go get must only work inside a module? >> >> >> Thanks >> Manlio Perillo >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.