func mkType(t string) string { … } func getType(t string) string { … } func isType(t string) bool { … } type TypeConfig … // typeof returns the type of the given name, which may be of // the form "x" or "p.X". func (cfg *TypeConfig) typeof(name string) string { … } type Type … // dot returns the type of "typ.name", making its decision // using the type information in cfg. func (typ *Type) dot(cfg *TypeConfig, name string) string { … } // typecheck type checks the AST f assuming the information in cfg. // It returns two maps with type information: // typeof maps AST nodes to type information in gofmt string form. // assign maps type strings to lists of expressions that were assigned // to values of another type that were assigned to that type. func typecheck(cfg *TypeConfig, f *ast.File) (typeof map[any]string, assign map[string][]any) { … } var reportCgoError … func makeExprList(a []*ast.Ident) []ast.Expr { … } // typecheck1 is the recursive form of typecheck. // It is like typecheck but adds to the information in typeof // instead of allocating a new map. func typecheck1(cfg *TypeConfig, f any, typeof map[any]string, assign map[string][]any) { … } // splitFunc splits "func(x,y,z) (a,b,c)" into ["x", "y", "z"] and ["a", "b", "c"]. func splitFunc(s string) (in, out []string) { … } // joinFunc is the inverse of splitFunc. func joinFunc(in, out []string) string { … } // split splits "int, float" into ["int", "float"] and splits "" into []. func split(s string) []string { … } // join is the inverse of split. func join(x []string) string { … }