From 8c058b32d1838e67d67277564b6cb9b0bccd1e75 Mon Sep 17 00:00:00 2001
From: Robert Griesemer
-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.
+The following built-in functions are not permitted in statement context:
+Expression statements
+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
: