Documentation ¶
Index ¶
- func AllDeclsFromAstPkg(pkg *ast.Package) []ast.Decl
- func AstFileToImportMap(file *ast.File) map[string]string
- func DirToAstWalker(targetDir string, fileFilter func(finfo os.FileInfo) bool) (map[string]AstPkgWalker, error)
- func GoFmtImports(pkgs map[string]string) string
- func LocalPathToPackagePath(s string) (string, error)
- func ParseFieldName(field *ast.Field) string
- func ToSortedFileListFromFileMapOfAst(s map[string]*ast.File) []*ast.File
- type AstPkgWalker
- func (w AstPkgWalker) AllFuncDecls() []*ast.FuncDecl
- func (w AstPkgWalker) AllGenDecls() []*ast.GenDecl
- func (w AstPkgWalker) AllStructSpecs() []*ast.TypeSpec
- func (w AstPkgWalker) AllTypeSpecs() []*ast.TypeSpec
- func (w AstPkgWalker) FindFuncDecl(filter func(*ast.FuncDecl) bool) *ast.FuncDecl
- func (w AstPkgWalker) FindTypeSpec(filter func(*ast.TypeSpec) bool) *ast.TypeSpec
- func (w AstPkgWalker) ToFile(node ast.Node) *ast.File
- func (w AstPkgWalker) ToTypePrinter(typeExpr ast.Expr) (TypePrinter, error)
- func (w AstPkgWalker) TypeSpecToGenDecl(spec *ast.TypeSpec) *ast.GenDecl
- type TypePrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirToAstWalker ¶
func GoFmtImports ¶
func LocalPathToPackagePath ¶
func ParseFieldName ¶
Types ¶
type AstPkgWalker ¶
type AstPkgWalker struct { FileSet *token.FileSet Pkg *ast.Package Files []*ast.File Decls []ast.Decl PkgPath string }
func ParseAstPkg ¶
func (AstPkgWalker) AllFuncDecls ¶
func (w AstPkgWalker) AllFuncDecls() []*ast.FuncDecl
func (AstPkgWalker) AllGenDecls ¶
func (w AstPkgWalker) AllGenDecls() []*ast.GenDecl
func (AstPkgWalker) AllStructSpecs ¶
func (w AstPkgWalker) AllStructSpecs() []*ast.TypeSpec
func (AstPkgWalker) AllTypeSpecs ¶
func (w AstPkgWalker) AllTypeSpecs() []*ast.TypeSpec
func (AstPkgWalker) FindFuncDecl ¶
func (AstPkgWalker) FindTypeSpec ¶
func (AstPkgWalker) ToTypePrinter ¶
func (w AstPkgWalker) ToTypePrinter(typeExpr ast.Expr) (TypePrinter, error)
func (AstPkgWalker) TypeSpecToGenDecl ¶
func (w AstPkgWalker) TypeSpecToGenDecl(spec *ast.TypeSpec) *ast.GenDecl
type TypePrinter ¶
type TypePrinter struct {
FullString string
}
func ToTypePrinter ¶
func (TypePrinter) ImportPkgMap ¶
func (p TypePrinter) ImportPkgMap(currentPkg string) map[string]string
func (TypePrinter) ImportPkgs ¶
func (p TypePrinter) ImportPkgs(currentPkg string) []string
func (TypePrinter) Print ¶
func (p TypePrinter) Print(currentPkg string) string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.