From: Robert Griesemer Date: Fri, 8 Mar 2013 04:11:37 +0000 (-0800) Subject: spec: clarify unsafe.Offsetof X-Git-Tag: go1.1rc2~634 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=51338095eb6fa331b64716dea1fed4fa8f513fef;p=gostls13.git spec: clarify unsafe.Offsetof Fixes #4905. R=rsc, r, iant, ken CC=golang-dev https://golang.org/cl/7583043 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 0fc918471d..5268a5b16d 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -5734,8 +5734,10 @@ as if 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: