mirror of
https://github.com/golang/go
synced 2024-11-12 01:10:21 -07:00
doc/effective_go: stamp out stray GOROOT reference
Replaced with something more appropriate. R=adg, r, minux.ma CC=golang-dev https://golang.org/cl/11421043
This commit is contained in:
parent
cc84176108
commit
deee03f17e
@ -1915,7 +1915,7 @@ initializer can be a general expression computed at run time.
|
||||
var (
|
||||
home = os.Getenv("HOME")
|
||||
user = os.Getenv("USER")
|
||||
goRoot = os.Getenv("GOROOT")
|
||||
gopath = os.Getenv("GOPATH")
|
||||
)
|
||||
</pre>
|
||||
|
||||
@ -1944,11 +1944,11 @@ func init() {
|
||||
if home == "" {
|
||||
home = "/home/" + user
|
||||
}
|
||||
if goRoot == "" {
|
||||
goRoot = home + "/go"
|
||||
if gopath == "" {
|
||||
gopath = home + "/go"
|
||||
}
|
||||
// goRoot may be overridden by --goroot flag on command line.
|
||||
flag.StringVar(&goRoot, "goroot", goRoot, "Go root directory")
|
||||
// gopath may be overridden by --gopath flag on command line.
|
||||
flag.StringVar(&gopath, "gopath", gopath, "override default GOPATH")
|
||||
}
|
||||
</pre>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user