Documentation ¶
Index ¶
- func ConvertToUnexported(name string) string
- func InferName(expr ast.Expr) string
- func IsExported(name string) bool
- func WriteFile(path string, fset *token.FileSet, file *ast.File) error
- type Compiler
- type Consumer
- type File
- type Func
- type Module
- type Package
- type ParseOptions
- type Type
- type TypeFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToUnexported ¶
ConvertToUnexported converts an exported identifier to an unexported one.
func IsExported ¶
IsExported determines whether or not a given name is exported.
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler is used for parsing Go source code files and compiling new source code files.
func NewCompiler ¶
NewCompiler creates a new compiler. This is meant to be used by downstream packages that provide consumers.
type Consumer ¶
type Consumer struct { Name string Package func(*Package, *goast.Package) bool FilePre func(*File, *goast.File) bool Import func(*File, *goast.ImportSpec) Struct func(*Type, *goast.StructType) Interface func(*Type, *goast.InterfaceType) FuncType func(*Type, *goast.FuncType) FuncDecl func(*Func, *goast.FuncType, *goast.BlockStmt) FilePost func(*File, *goast.File) error }
Consumer is used for processing AST nodes. This is meant to be provided by downstream packages.
type Func ¶
Func contains information about a parsed function.
func (*Func) IsExported ¶
IsExported determines whether or not a function is exported.
type ParseOptions ¶
type ParseOptions struct { MergePackageFiles bool SkipTestFiles bool TypeFilter TypeFilter }
ParseOptions configure how Go source code files should be parsed.
type Type ¶
Type contains information about a parsed type.
func (*Type) IsExported ¶
IsExported determines whether or not a type is exported.