type Scope … // NewScope creates a new scope nested in the outer scope. func NewScope(outer *Scope) *Scope { … } // Lookup returns the object with the given name if it is // found in scope s, otherwise it returns nil. Outer scopes // are ignored. func (s *Scope) Lookup(name string) *Object { … } // Insert attempts to insert a named object obj into the scope s. // If the scope already contains an object alt with the same name, // Insert leaves the scope unchanged and returns alt. Otherwise // it inserts obj and returns nil. func (s *Scope) Insert(obj *Object) (alt *Object) { … } // Debugging support func (s *Scope) String() string { … } type Object … // NewObj creates a new object of a given kind and name. func NewObj(kind ObjKind, name string) *Object { … } // Pos computes the source position of the declaration of an object name. // The result may be an invalid position if it cannot be computed // (obj.Decl may be nil or not correct). func (obj *Object) Pos() token.Pos { … } type ObjKind … const Bad … const Pkg … const Con … const Typ … const Var … const Fun … const Lbl … var objKindStrings … func (kind ObjKind) String() string { … }