From 506c00809231f7ab7413314bbfe7c2ce016f046b Mon Sep 17 00:00:00 2001
From: Robert Griesemer
-The package clause (§Package clause) is not a declaration; the package name +The package clause is not a declaration; the package name does not appear in any scope. Its purpose is to identify the files belonging -to the same package (§Packages) and to specify the default name for import +to the same package and to specify the default name for import declarations.
@@ -1324,7 +1324,7 @@ declarations.
-Labels are declared by labeled statements (§Labeled statements) and are
+Labels are declared by labeled statements and are
used in the break
, continue
, and goto
statements (§Break statements, §Continue statements, §Goto statements).
In contrast to other identifiers, labels are not block scoped and do
@@ -1376,10 +1376,10 @@ All other identifiers are not exported.
A constant declaration binds a list of identifiers (the names of -the constants) to the values of a list of constant expressions -(§Constant expressions). The number of identifiers must be equal -to the number of expressions, and the nth identifier on -the left is bound to value of the nth expression on the +the constants) to the values of a list of constant expressions. +The number of identifiers must be equal +to the number of expressions, and the nth identifier on +the left is bound to the value of the nth expression on the right.
@@ -1395,8 +1395,8 @@ ExpressionList = Expression { "," Expression } .If the type is omitted, the constants take the individual types of the corresponding expressions, which may be -ideal integer or ideal float (§Ideal number). If the type -is present, all constants take the type specified, and the types +an ideal number or ideal string. +If the type is present, all constants take the type specified, and the types of all the expressions must be assignment-compatible with that type.
@@ -1420,8 +1420,8 @@ first preceding non-empty expression list, and its type if any. Omitting the list of expressions is therefore equivalent to repeating the previous list. The number of identifiers must be equal to the number of expressions in the previous list. -Together with theiota
constant generator
-(§Iota) this mechanism permits light-weight declaration of sequential values:
+Together with the iota
constant generator
+this mechanism permits light-weight declaration of sequential values:
@@ -1547,8 +1547,7 @@ var (If a list of expressions is given, the variables are initialized by assigning those expressions to the variables (§Assignments). -Otherwise, each variable is initialized to its zero value -(§The zero value). +Otherwise, each variable is initialized to its zero value.
@@ -2118,8 +2117,8 @@ rules apply:
For
a
of typeA
or*A
-whereA
is an array type (§Array types), -or fora
of typeS
whereS
is a slice type (§Slice types): +whereA
is an array type, +or fora
of typeS
whereS
is a slice type:
x
must be an integer value and 0 <= x < len(a)
@@ -2129,7 +2128,7 @@ or for a
of type S
where S
is a slice typ
For a
of type T
-where T
is a string type (§Strings):
+where T
is a string type:
x
must be an integer value and 0 <= x < len(a)
@@ -2140,7 +2139,7 @@ where T
is a string type (§Strings):
For a
of type M
-where M
is a map type (§Map types):
+where M
is a map type:
x
's type must be compatible with the key type of M
@@ -2171,7 +2170,7 @@ the result of the index expression is a pair of values with types
If the key is present in the map,
the expression returns the pair (a[x], true)
;
otherwise it returns (Z, false)
where Z
is
-the zero value for V
(§The zero value).
+the zero value for V
.
No run-time exception occurs in this case.
The index expression in this construct thus acts like a function call
returning a value and a boolean indicating success. (§Assignments)
@@ -2223,8 +2222,8 @@ For arrays or strings, the indexes
for slices, the upper bound is the capacity rather than the length.
If the sliced operand is a string, the result of the slice operation is another, new -string (§Strings). If the sliced operand is an array or slice, the result -of the slice operation is a slice (§Slice types). +string. If the sliced operand is an array or slice, the result +of the slice operation is a slice.
@@ -2272,7 +2271,7 @@ var v, ok = x.(T) the result of the assertion is a pair of values with types(T, bool)
.
If the assertion holds, the expression returns the pair (x.(T), true)
;
otherwise, the expression returns (Z, false)
where Z
-is the zero value for type T
(§The zero value).
+is the zero value for type T
.
No run-time exception occurs in this case.
The type assertion in this construct thus acts like a function call
returning a value and a boolean indicating success. (§Assignments)
@@ -2884,7 +2883,7 @@ In practice, constant expressions are those that can be evaluated at compile tim
The type of a constant expression is determined by the type of its elements. If it contains only numeric literals, its type is ideal -integer or ideal float (§Ideal number). Whether a literal +integer or ideal float (§Ideal numbers). Whether a literal is an integer or float depends on the syntax of the literals (123 vs. 123.0). The nature of the arithmetic operations within the expression depends, elementwise, on the values; @@ -3008,8 +3007,7 @@ Elements of a list of statements are separated by semicolons, which may be omitted only if the previous statement:
-The following assignment statements (§Assignments) are semantically +The following assignment statements are semantically equivalent:
@@ -3125,8 +3123,8 @@ a[i] <<= 2 A tuple assignment assigns the individual elements of a multi-valued operation to a list of variables. There are two forms. In the first, the right hand operand is a single multi-valued expression -such as a function evaluation or channel or map operation (§Channel -operations, §Map operations) or a type assertion (§Type assertions). +such as a function evaluation or channel or +map operation or a type assertion. The number of operands on the left hand side must match the number of values. For instance, Iff
is a function returning two values,
--
2.48.1