From 51338095eb6fa331b64716dea1fed4fa8f513fef Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 7 Mar 2013 20:11:37 -0800 Subject: [PATCH] spec: clarify unsafe.Offsetof Fixes #4905. R=rsc, r, iant, ken CC=golang-dev https://golang.org/cl/7583043 --- doc/go_spec.html | 8 +++++--- 1 file 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 @@ @@ -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:

-- 2.48.1