// path[0] is known to be *ast.Ident func definition(path []ast.Node, obj types.Object, pgf *parsego.File) ([]CompletionItem, *Selection) { … } // defMatches returns text for defItem, never for defSnippet func defMatches(name, pat string, path []ast.Node, arg string) string { … } func defSnippet(prefix, suffix string, obj types.Object) CompletionItem { … } func defItem(val string, obj types.Object) CompletionItem { … }