1
1
<!--{
2
2
"Title": "The Go Programming Language Specification",
3
- "Subtitle": "Version of June 21 , 2022",
3
+ "Subtitle": "Version of June 29 , 2022",
4
4
"Path": "/ref/spec"
5
5
}-->
6
6
@@ -263,7 +263,7 @@ <h3 id="Operators_and_punctuation">Operators and punctuation</h3>
263
263
264
264
< p >
265
265
The following character sequences represent < a href ="#Operators "> operators</ a >
266
- (including < a href ="#Assignments "> assignment operators</ a > ) and punctuation:
266
+ (including < a href ="#Assignment_statements "> assignment operators</ a > ) and punctuation:
267
267
</ p >
268
268
< pre class ="grammar ">
269
269
+ & += &= && == != ( )
@@ -676,7 +676,7 @@ <h2 id="Constants">Constants</h2>
676
676
A constant may be given a type explicitly by a < a href ="#Constant_declarations "> constant declaration</ a >
677
677
or < a href ="#Conversions "> conversion</ a > , or implicitly when used in a
678
678
< a href ="#Variable_declarations "> variable declaration</ a > or an
679
- < a href ="#Assignments "> assignment</ a > or as an
679
+ < a href ="#Assignment_statements "> assignment statement </ a > or as an
680
680
operand in an < a href ="#Expressions "> expression</ a > .
681
681
It is an error if the constant value
682
682
cannot be < a href ="#Representability "> represented</ a > as a value of the respective type.
@@ -780,7 +780,7 @@ <h2 id="Variables">Variables</h2>
780
780
< p >
781
781
A variable's value is retrieved by referring to the variable in an
782
782
< a href ="#Expressions "> expression</ a > ; it is the most recent value
783
- < a href ="#Assignments "> assigned</ a > to the variable.
783
+ < a href ="#Assignment_statements "> assigned</ a > to the variable.
784
784
If a variable has not yet been assigned a value, its value is the
785
785
< a href ="#The_zero_value "> zero value</ a > for its type.
786
786
</ p >
@@ -1591,7 +1591,7 @@ <h3 id="Map_types">Map types</h3>
1591
1591
For a map < code > m</ code > , it can be discovered using the
1592
1592
built-in function < a href ="#Length_and_capacity "> < code > len</ code > </ a >
1593
1593
and may change during execution. Elements may be added during execution
1594
- using < a href ="#Assignments "> assignments</ a > and retrieved with
1594
+ using < a href ="#Assignment_statements "> assignments</ a > and retrieved with
1595
1595
< a href ="#Index_expressions "> index expressions</ a > ; they may be removed with the
1596
1596
< a href ="#Deletion_of_map_elements "> < code > delete</ code > </ a > built-in function.
1597
1597
</ p >
@@ -1634,7 +1634,7 @@ <h3 id="Channel_types">Channel types</h3>
1634
1634
< i > send</ i > or < i > receive</ i > . If a direction is given, the channel is < i > directional</ i > ,
1635
1635
otherwise it is < i > bidirectional</ i > .
1636
1636
A channel may be constrained only to send or only to receive by
1637
- < a href ="#Assignments "> assignment</ a > or
1637
+ < a href ="#Assignment_statements "> assignment</ a > or
1638
1638
explicit < a href ="#Conversions "> conversion</ a > .
1639
1639
</ p >
1640
1640
@@ -2241,7 +2241,7 @@ <h3 id="Blank_identifier">Blank identifier</h3>
2241
2241
The < i > blank identifier</ i > is represented by the underscore character < code > _</ code > .
2242
2242
It serves as an anonymous placeholder instead of a regular (non-blank)
2243
2243
identifier and has special meaning in < a href ="#Declarations_and_scope "> declarations</ a > ,
2244
- as an < a href ="#Operands "> operand</ a > , and in < a href ="#Assignments " > assignments </ a > .
2244
+ as an < a href ="#Operands "> operand</ a > , and in < a href ="#Assignment_statements " > assignment statements </ a > .
2245
2245
</ p >
2246
2246
2247
2247
@@ -2748,7 +2748,7 @@ <h3 id="Variable_declarations">Variable declarations</h3>
2748
2748
2749
2749
< p >
2750
2750
If a list of expressions is given, the variables are initialized
2751
- with the expressions following the rules for < a href ="#Assignments " > assignments </ a > .
2751
+ with the expressions following the rules for < a href ="#Assignment_statements " > assignment statements </ a > .
2752
2752
Otherwise, each variable is initialized to its < a href ="#The_zero_value "> zero value</ a > .
2753
2753
</ p >
2754
2754
@@ -3011,7 +3011,7 @@ <h3 id="Operands">Operands</h3>
3011
3011
3012
3012
< p >
3013
3013
The < a href ="#Blank_identifier "> blank identifier</ a > may appear as an
3014
- operand only on the left-hand side of an < a href ="#Assignments "> assignment</ a > .
3014
+ operand only on the left-hand side of an < a href ="#Assignment_statements "> assignment statement </ a > .
3015
3015
</ p >
3016
3016
3017
3017
< p >
@@ -3821,7 +3821,7 @@ <h3 id="Index_expressions">Index expressions</h3>
3821
3821
3822
3822
< p >
3823
3823
An index expression on a map < code > a</ code > of type < code > map[K]V</ code >
3824
- used in an < a href ="#Assignments "> assignment</ a > or initialization of the special form
3824
+ used in an < a href ="#Assignment_statements "> assignment statement </ a > or initialization of the special form
3825
3825
</ p >
3826
3826
3827
3827
< pre >
@@ -4037,7 +4037,7 @@ <h3 id="Type_assertions">Type assertions</h3>
4037
4037
</ pre >
4038
4038
4039
4039
< p >
4040
- A type assertion used in an < a href ="#Assignments "> assignment</ a > or initialization of the special form
4040
+ A type assertion used in an < a href ="#Assignment_statements "> assignment statement </ a > or initialization of the special form
4041
4041
</ p >
4042
4042
4043
4043
< pre >
@@ -5194,7 +5194,7 @@ <h3 id="Receive_operator">Receive operator</h3>
5194
5194
</ pre >
5195
5195
5196
5196
< p >
5197
- A receive expression used in an < a href ="#Assignments "> assignment</ a > or initialization of the special form
5197
+ A receive expression used in an < a href ="#Assignment_statements "> assignment statement </ a > or initialization of the special form
5198
5198
</ p >
5199
5199
5200
5200
< pre >
@@ -5942,7 +5942,7 @@ <h3 id="IncDec_statements">IncDec statements</h3>
5942
5942
</ pre >
5943
5943
5944
5944
< p >
5945
- The following < a href ="#Assignments "> assignment statements</ a > are semantically
5945
+ The following < a href ="#Assignment_statements "> assignment statements</ a > are semantically
5946
5946
equivalent:
5947
5947
</ p >
5948
5948
@@ -5953,7 +5953,14 @@ <h3 id="IncDec_statements">IncDec statements</h3>
5953
5953
</ pre >
5954
5954
5955
5955
5956
- < h3 id ="Assignments "> Assignments</ h3 >
5956
+ < h3 id ="Assignment_statements "> Assignment statements</ h3 >
5957
+
5958
+ < p >
5959
+ An < i > assignment</ i > replaces the current value stored in a < a href ="#Variables "> variable</ a >
5960
+ with a new value specified by an < a href ="#Expressions "> expression</ a > .
5961
+ An assignment statement may assign a single value to a single variable, or multiple values to a
5962
+ matching number of variables.
5963
+ </ p >
5957
5964
5958
5965
< pre class ="ebnf ">
5959
5966
Assignment = ExpressionList assign_op ExpressionList .
@@ -6522,7 +6529,7 @@ <h4 id="For_range">For statements with <code>range</code> clause</h4>
6522
6529
6523
6530
< p >
6524
6531
The iteration values are assigned to the respective
6525
- iteration variables as in an < a href ="#Assignments "> assignment statement</ a > .
6532
+ iteration variables as in an < a href ="#Assignment_statements "> assignment statement</ a > .
6526
6533
</ p >
6527
6534
6528
6535
< p >
0 commit comments