diff --git a/doc/go_spec.html b/doc/go_spec.html index fc61bdd4c07..675970300dd 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -3798,7 +3798,9 @@ Error: log.Panic("error encountered")

Expression statements

-Function calls, method calls, and receive operations +With the exception of specific built-in functions, +function and method calls and +receive operations can appear in statement context. Such statements may be parenthesized.

@@ -3806,11 +3808,21 @@ can appear in statement context. Such statements may be parenthesized. ExpressionStmt = Expression . +

+The following built-in functions are not permitted in statement context: +

+ +
+append cap complex imag len make new real
+unsafe.Alignof unsafe.Offsetof unsafe.Sizeof
+
+
 h(x+y)
 f.Close()
 <-ch
 (<-ch)
+len("foo")  // illegal if len is the built-in function
 
@@ -5492,8 +5504,8 @@ of any type and return the alignment or size, respectively, of a hypothetical va as if v was declared via var v = x.

-The function Offsetof takes a selector (ยงSelectors) denoting a struct -field of any type and returns the field offset in bytes relative to the +The function Offsetof takes a (possibly parenthesized) selector +denoting a struct field of any type and returns the field offset in bytes relative to the struct's address. For a struct s with field f: