Descriptioncmd/go: remove $GOROOT as a go get target
Fixes issue 4186.
Back in the day, before the Go 1.0 release, $GOROOT was mandatory for building from source. Fast forward to now and $GOPATH is mandatory and $GOROOT is optional, and mainly used by those who use the binary distribution in uncommon places.
For example, most novices at least know about `sudo` as they would have used it to install the binary tarball into /usr/local. It is logical they would use the `sudo` hammer to `go get` other Go packages when faced with a permission error talking about the path they just had to use `sudo` on last time.
Even if they had read the documentation and set $GOPATH, go get will not work as expected as `sudo` masks most environment variables.
llucky(~) % ~/go/bin/go env | grep GOPATH
GOPATH="/home/dfc"
lucky(~) % sudo ~/go/bin/go env | grep GOPATH
GOPATH=""
This CL therefore proposes to remove support for using `go get` to download source into $GOROOT.
This CL also proposes an error when GOPATH=$GOROOT, as this is another place where new Go users can get stuck.
Further discussion: https://groups.google.com/d/topic/golang-nuts/VIg3fjHiHRI/discussion
Patch Set 1 #Patch Set 2 : diff -r 5a40587c014a https://code.google.com/p/go #
Total comments: 3
Patch Set 3 : diff -r 5a40587c014a https://code.google.com/p/go #
Total comments: 2
Patch Set 4 : diff -r 5a40587c014a https://code.google.com/p/go #Patch Set 5 : code review 6941058: cmd/go: remove $GOROOT as a go get target #Patch Set 6 : diff -r 87637f1ff532 https://code.google.com/p/go #
Total comments: 8
Patch Set 7 : diff -r 1481cdef28a6 https://code.google.com/p/go #Patch Set 8 : diff -r 5acb449b2a67 https://code.google.com/p/go #
Total comments: 11
Patch Set 9 : diff -r d0d76b7fb219 https://code.google.com/p/go #Patch Set 10 : diff -r d0d76b7fb219 https://go.googlecode.com/hg/ #Patch Set 11 : diff -r d0d76b7fb219 https://go.googlecode.com/hg/ #Patch Set 12 : diff -r d0d76b7fb219 https://go.googlecode.com/hg/ #Patch Set 13 : diff -r c529f87b63d1 https://go.googlecode.com/hg/ #Patch Set 14 : diff -r c529f87b63d1 https://go.googlecode.com/hg/ #Patch Set 15 : diff -r 4254b351ee3c https://code.google.com/p/go #Patch Set 16 : diff -r 4254b351ee3c https://code.google.com/p/go #
MessagesTotal messages: 31
|