Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
3e2a8887
Commit
3e2a8887
authored
Nov 08, 2012
by
Nigel Tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/effective_go: don't use ALL_CAPS for variable names.
R=r, dsymonds CC=golang-dev
https://golang.org/cl/6826070
parent
64b3e590
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
effective_go.html
doc/effective_go.html
+10
-10
No files found.
doc/effective_go.html
View file @
3e2a8887
...
...
@@ -1745,9 +1745,9 @@ initializer can be a general expression computed at run time.
</p>
<pre>
var (
HOME
= os.Getenv("HOME")
USER
= os.Getenv("USER")
GOROOT
= os.Getenv("GOROOT")
home
= os.Getenv("HOME")
user
= os.Getenv("USER")
goRoot
= os.Getenv("GOROOT")
)
</pre>
...
...
@@ -1770,17 +1770,17 @@ correctness of the program state before real execution begins.
<pre>
func init() {
if
USER
== "" {
if
user
== "" {
log.Fatal("$USER not set")
}
if
HOME
== "" {
HOME = "/home/" + USER
if
home
== "" {
home = "/home/" + user
}
if
GOROOT
== "" {
GOROOT = HOME
+ "/go"
if
goRoot
== "" {
goRoot = home
+ "/go"
}
//
GOROOT
may be overridden by --goroot flag on command line.
flag.StringVar(
&
GOROOT, "goroot", GOROOT
, "Go root directory")
//
goRoot
may be overridden by --goroot flag on command line.
flag.StringVar(
&
goRoot, "goroot", goRoot
, "Go root directory")
}
</pre>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment