• Dave Cheney's avatar
    cmd/go: remove $GOROOT as a go get target · 593d8b0c
    Dave Cheney authored
    Fixes #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
    
    R=rsc, adg, minux.ma
    CC=golang-dev
    https://golang.org/cl/6941058
    593d8b0c
Name
Last commit
Last update
..
articles Loading commit data...
codewalk Loading commit data...
devel Loading commit data...
gopher Loading commit data...
play Loading commit data...
progs Loading commit data...
Makefile Loading commit data...
cmd.html Loading commit data...
code.html Loading commit data...
contrib.html Loading commit data...
contribute.html Loading commit data...
debugging_with_gdb.html Loading commit data...
docs.html Loading commit data...
effective_go.html Loading commit data...
gccgo_contribute.html Loading commit data...
gccgo_install.html Loading commit data...
go-logo-black.png Loading commit data...
go-logo-blue.png Loading commit data...
go-logo-white.png Loading commit data...
go1.1.html Loading commit data...
go1.html Loading commit data...
go1compat.html Loading commit data...
go_faq.html Loading commit data...
go_mem.html Loading commit data...
go_spec.html Loading commit data...
godocs.js Loading commit data...
help.html Loading commit data...
ie.css Loading commit data...
install-source.html Loading commit data...
install.html Loading commit data...
jquery.js Loading commit data...
logo-153x55.png Loading commit data...
reference.html Loading commit data...
root.html Loading commit data...
share.png Loading commit data...
sieve.gif Loading commit data...
style.css Loading commit data...
tos.html Loading commit data...