aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2013-03-07 20:11:37 -0800
committerRobert Griesemer <gri@golang.org>2013-03-07 20:11:37 -0800
commit51338095eb6fa331b64716dea1fed4fa8f513fef (patch)
tree7f224fff317f3e3bb3a8356a4d38e16745125814
parent7663ffcae641dbf06b9d5321c9afbad4fc73e336 (diff)
downloadgo-51338095eb6fa331b64716dea1fed4fa8f513fef.tar.xz
spec: clarify unsafe.Offsetof
Fixes #4905. R=rsc, r, iant, ken CC=golang-dev https://golang.org/cl/7583043
-rw-r--r--doc/go_spec.html8
1 files changed, 5 insertions, 3 deletions
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 @@
<!--{
"Title": "The Go Programming Language Specification",
- "Subtitle": "Version of March 4, 2013",
+ "Subtitle": "Version of March 7, 2013",
"Path": "/ref/spec"
}-->
@@ -5734,8 +5734,10 @@ as if <code>v</code> was declared via <code>var v = x</code>.
</p>
<p>
The function <code>Offsetof</code> takes a (possibly parenthesized) <a href="#Selectors">selector</a>
-denoting a struct field of any type and returns the field offset in bytes relative to the
-struct's address.
+<code>s.f</code>, denoting a field <code>f</code> of the struct denoted by <code>s</code>
+or <code>*s</code>, and returns the field offset in bytes relative to the struct's address.
+If <code>f</code> is an <a href="#Struct_types">embedded field</a>, it must be reachable
+without pointer indirections through fields of the struct.
For a struct <code>s</code> with field <code>f</code>:
</p>