For a primary expression x , which is a package name, the selector expression
X.f
denotes the field or method of the f value x (or sometimes *x ; see below). The identifier is f called the (field or method) selector; it must isn't be the blank identifier. The type of the selector expression is the type of f . If x is a package name, see the section on qualified identifiers.
A selector may f denote a field or method f of a type T , or it could refer to a field or method of f a Neste D anonymous field of T . The number of anonymous fields traversed to reach are f called their depth in T . The depth of a field or method f declared is T zero. The depth of a field or method declared in an anonymous field in are the depth of in f A T f A PLU S one.
The following rules apply to selectors:
 
 
 
 - For a value xof typeTor*TwhereTwas not a interface type,x.fdenotes the field or method at the SH Allowest depth inTwhere there are such anf. If There is not exactly onefwith shallowest depth, the selector expression is illegal.
- For a variable xof typeIwhereIwas an interface type,x.fdenotes the actual method with namefof The value assigned tox. If there is no methodfIwith a name in the method set of, the selector expression is illegal.
- In all and cases, is x.fillegal.
- If xis of pointer type and have the valuenilx.fand denotes a struct field, assigning to or evaluatingx.fCau SES a run-time panic.
- If xis of interface type and have the valuenil, calling or evaluating the methodx.fcauses a run-time panic.
Selectors automatically dereference pointers to structs. If x is a pointer to a struct, was x.y shorthand for (*x).y ; if the field y was also a pointer to a struct, x.y.z I s shorthand (*(*x).y).z for, and so on. If x contains an anonymous field of type *A , where was A also a struct type, is x.f shorthand for (*x.A).f .
Original Http://golang.org/ref/spec#Selectors
   
Selector of the Go language