type declInfo … // hasInitializer reports whether the declared object has an initialization // expression or function body. func (d *declInfo) hasInitializer() bool { … } // addDep adds obj to the set of objects d's init expression depends on. func (d *declInfo) addDep(obj Object) { … } // arity checks that the lhs and rhs of a const or var decl // have a matching number of names and initialization values. // If inherited is set, the initialization values are from // another (constant) declaration. func (check *Checker) arity(pos syntax.Pos, names []*syntax.Name, inits []syntax.Expr, constDecl, inherited bool) { … } func validatedImportPath(path string) (string, error) { … } // declarePkgObj declares obj in the package scope, records its ident -> obj mapping, // and updates check.objMap. The object must not be a function or method. func (check *Checker) declarePkgObj(ident *syntax.Name, obj Object, d *declInfo) { … } // filename returns a filename suitable for debugging output. func (check *Checker) filename(fileNo int) string { … } func (check *Checker) importPackage(pos syntax.Pos, path, dir string) *Package { … } // collectObjects collects all file and package objects and inserts them // into their respective scopes. It also performs imports and associates // methods with receiver base type names. func (check *Checker) collectObjects() { … } // unpackRecv unpacks a receiver type expression and returns its components: ptr indicates // whether rtyp is a pointer receiver, base is the receiver base type expression stripped // of its type parameters (if any), and tparams are its type parameter names, if any. The // type parameters are only unpacked if unpackParams is set. For instance, given the rtyp // // *T[A, _] // // ptr is true, base is T, and tparams is [A, _] (assuming unpackParams is set). // Note that base may not be a *syntax.Name for erroneous programs. func (check *Checker) unpackRecv(rtyp syntax.Expr, unpackParams bool) (ptr bool, base syntax.Expr, tparams []*syntax.Name) { … } // resolveBaseTypeName returns the non-alias base type name for typ, and whether // there was a pointer indirection to get to it. The base type name must be declared // in package scope, and there can be at most one pointer indirection. If no such type // name exists, the returned base is nil. func (check *Checker) resolveBaseTypeName(seenPtr bool, typ syntax.Expr, lookupScope func(*syntax.Name) *Scope) (ptr bool, base *TypeName) { … } // packageObjects typechecks all package objects, but not function bodies. func (check *Checker) packageObjects() { … } // unusedImports checks for unused imports. func (check *Checker) unusedImports() { … } func (check *Checker) errorUnusedPkg(obj *PkgName) { … } // dir makes a good-faith attempt to return the directory // portion of path. If path is empty, the result is ".". // (Per the go/build package dependency tests, we cannot import // path/filepath and simply use filepath.Dir.) func dir(path string) string { … }