var ErrNoIdentFound … // inferredSignature determines the resolved non-generic signature for an // identifier in an instantiation expression. // // If no such signature exists, it returns nil. func inferredSignature(info *types.Info, id *ast.Ident) *types.Signature { … } // searchForEnclosing returns, given the AST path to a SelectorExpr, // the exported named type of the innermost implicit field selection. // // For example, given "new(A).d" where this is (due to embedding) a // shorthand for "new(A).b.c.d", it returns the named type of c, // if it is exported, otherwise the type of b, or A. func searchForEnclosing(info *types.Info, path []ast.Node) *types.TypeName { … } // typeToObject returns the relevant type name for the given type, after // unwrapping pointers, arrays, slices, channels, and function signatures with // a single non-error result, and ignoring built-in named types. func typeToObject(typ types.Type) *types.TypeName { … } func hasErrorType(obj types.Object) bool { … } // typeSwitchImplicits returns all the implicit type switch objects that // correspond to the leaf *ast.Ident. It also returns the original type // associated with the identifier (outside of a case clause). func typeSwitchImplicits(info *types.Info, path []ast.Node) ([]types.Object, types.Type) { … }