Commit 3e2a8887 authored by Nigel Tao's avatar Nigel Tao

doc/effective_go: don't use ALL_CAPS for variable names.

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/6826070
parent 64b3e590
...@@ -1745,9 +1745,9 @@ initializer can be a general expression computed at run time. ...@@ -1745,9 +1745,9 @@ initializer can be a general expression computed at run time.
</p> </p>
<pre> <pre>
var ( var (
HOME = os.Getenv("HOME") home = os.Getenv("HOME")
USER = os.Getenv("USER") user = os.Getenv("USER")
GOROOT = os.Getenv("GOROOT") goRoot = os.Getenv("GOROOT")
) )
</pre> </pre>
...@@ -1770,17 +1770,17 @@ correctness of the program state before real execution begins. ...@@ -1770,17 +1770,17 @@ correctness of the program state before real execution begins.
<pre> <pre>
func init() { func init() {
if USER == "" { if user == "" {
log.Fatal("$USER not set") log.Fatal("$USER not set")
} }
if HOME == "" { if home == "" {
HOME = "/home/" + USER home = "/home/" + user
} }
if GOROOT == "" { if goRoot == "" {
GOROOT = HOME + "/go" goRoot = home + "/go"
} }
// GOROOT may be overridden by --goroot flag on command line. // goRoot may be overridden by --goroot flag on command line.
flag.StringVar(&amp;GOROOT, "goroot", GOROOT, "Go root directory") flag.StringVar(&amp;goRoot, "goroot", goRoot, "Go root directory")
} }
</pre> </pre>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment