summaryrefslogtreecommitdiff
path: root/doc/go_for_cpp_programmers.html
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-01-17 12:40:45 +0100
committerOndřej Surý <ondrej@sury.org>2011-01-17 12:40:45 +0100
commit3e45412327a2654a77944249962b3652e6142299 (patch)
treebc3bf69452afa055423cbe0c5cfa8ca357df6ccf /doc/go_for_cpp_programmers.html
parentc533680039762cacbc37db8dc7eed074c3e497be (diff)
downloadgolang-upstream/2011.01.12.tar.gz
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'doc/go_for_cpp_programmers.html')
-rw-r--r--doc/go_for_cpp_programmers.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/go_for_cpp_programmers.html b/doc/go_for_cpp_programmers.html
index a2291715c..fae2ec44e 100644
--- a/doc/go_for_cpp_programmers.html
+++ b/doc/go_for_cpp_programmers.html
@@ -198,7 +198,7 @@ the <code>else</code>, causing a syntax error.
Since semicolons do end statements, you may continue using them as in
C++. However, that is not the recommended style. Idiomatic Go code
omits unnecessary semicolons, which in practice is all of them other
-than the initial <for> loop clause and cases where you want several
+than the initial <code>for</code> loop clause and cases where you want several
short statements on a single line.
<p>
@@ -668,7 +668,7 @@ func manager(ch chan cmd) {
var val int = 0
for {
c := &lt;- ch
- if c.get { c.val = val ch &lt;- c }
+ if c.get { c.val = val; ch &lt;- c }
else { val = c.val }
}
}