From: Robert Griesemer v
was declared via var v = x
.
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.
+s.f
, denoting a field f
of the struct denoted by s
+or *s
, and returns the field offset in bytes relative to the struct's address.
+If f
is an embedded field, it must be reachable
+without pointer indirections through fields of the struct.
For a struct s
with field f
: