mirror of
https://github.com/golang/go
synced 2024-11-22 01:44:40 -07:00
go spec: fix iota description
R=r, rsc CC=golang-dev https://golang.org/cl/946046
This commit is contained in:
parent
452dd3829e
commit
39f009cb8e
@ -1648,12 +1648,11 @@ const (
|
|||||||
<h3 id="Iota">Iota</h3>
|
<h3 id="Iota">Iota</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Within a constant declaration, the predeclared identifier
|
Within a <a href="#Constant_declarations">constant declaration</a>, the predeclared identifier
|
||||||
<code>iota</code> represents successive untyped integer <a href="#Constants">
|
<code>iota</code> represents successive untyped integer <a href="#Constants">
|
||||||
constants</a>. It is reset to 0 whenever the reserved word <code>const</code>
|
constants</a>. It is reset to 0 whenever the reserved word <code>const</code>
|
||||||
appears in the source and increments with each
|
appears in the source and increments after each <a href="#ConstSpec">ConstSpec</a>.
|
||||||
<a href="#Semicolons">semicolon</a>. It can be used to construct a
|
It can be used to construct a set of related constants:
|
||||||
set of related constants:
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
@ -1681,7 +1680,7 @@ const y = iota // y == 0 (iota has been reset)
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
Within an ExpressionList, the value of each <code>iota</code> is the same because
|
Within an ExpressionList, the value of each <code>iota</code> is the same because
|
||||||
it is only incremented at a semicolon:
|
it is only incremented after each ConstSpec:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
Loading…
Reference in New Issue
Block a user