Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Preprocess ¶
func Preprocess(fset *token.FileSet, f *ast.File, getDefaultPackageName func(path string) (string, error)) error
Preprocess reduces the AST in ways, which remove information not necessary for binding generation. It does the following:
- Remove function parameter names.
- Remove all unneeded function bodies.
- Remove all unneeded variable declarations.
- Remove most unneeded imports, including those no longer needed due to previous AST reduction (imports as "." cannot be removed, as there isn't enough semantic context in the package AST).
Passing an unpopulated fset may lead to a nil pointer dereference! getDefaultPackageName should return the default import name of the given package.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.