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
029c39f4
Commit
029c39f4
authored
Nov 15, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some typos in the documentation
Fixes #196. R=rsc
https://golang.org/cl/154152
parent
27779dd6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
effective_go.html
doc/effective_go.html
+2
-2
go_tutorial.html
doc/go_tutorial.html
+2
-2
go_tutorial.txt
doc/go_tutorial.txt
+1
-1
No files found.
doc/effective_go.html
View file @
029c39f4
...
...
@@ -977,14 +977,14 @@ you can pass a pointer to the array.
<pre>
func Sum(a *[3]float) (sum float) {
for _, v := range a {
for _, v := range
*
a {
sum += v
}
return
}
array := [...]float{7.0, 8.5, 9.1};
x :=
s
um(
&
array); // Note the explicit address-of operator
x :=
S
um(
&
array); // Note the explicit address-of operator
</pre>
<p>
...
...
doc/go_tutorial.html
View file @
029c39f4
...
...
@@ -550,7 +550,7 @@ declaration on line 31; it declares <code>r</code> and <code>e</code> to hold th
both of type
<code>
int
</code>
(although you'd have to look at the
<code>
syscall
</code>
package
to see that). Finally, line 35 returns two values: a pointer to the new
<code>
File
</code>
and the error. If
<code>
syscall.Open
</code>
fails, the file descriptor
<code>
r
</code>
will
be negative and
<code>
N
ewFile
</code>
will return
<code>
nil
</code>
.
be negative and
<code>
n
ewFile
</code>
will return
<code>
nil
</code>
.
<p>
About those errors: The
<code>
os
</code>
library includes a general notion of an error.
It's a good idea to use its facility in your own interfaces, as we do here, for
...
...
@@ -1279,7 +1279,7 @@ code that invokes the operation and responds to the request:
19 }
</pre>
<p>
Line 1
8
defines the name
<code>
binOp
</code>
to be a function taking two integers and
Line 1
4
defines the name
<code>
binOp
</code>
to be a function taking two integers and
returning a third.
<p>
The
<code>
server
</code>
routine loops forever, receiving requests and, to avoid blocking due to
...
...
doc/go_tutorial.txt
View file @
029c39f4
...
...
@@ -841,7 +841,7 @@ code that invokes the operation and responds to the request:
--PROG progs/server.go /type.binOp/ /^}/
Line 1
8
defines the name "binOp" to be a function taking two integers and
Line 1
4
defines the name "binOp" to be a function taking two integers and
returning a third.
The "server" routine loops forever, receiving requests and, to avoid blocking due to
...
...
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