Documentation
¶
Index ¶
- Variables
- func Ast2Str(decls any) (string, error)
- func GoFmt(fp string)
- func GoInit(name string)
- func GoModtidy()
- func NewAstField(name, typ, tag string) *ast.Field
- func NewTsTpl(fPath string) (*simpleTsTemplate, error)
- func OpenAbsFile(p ...string) *os.File
- func OpenFile(p ...string) *os.File
- func T(p ...string) *template.Template
- type Ast
- func (a *Ast) AddImport(repo string, tags ...string) error
- func (a *Ast) AddMethod(fc *ast.FuncDecl, reWrite bool) bool
- func (a *Ast) AddStruct(name string, styp *ast.StructType) error
- func (a *Ast) AddStructMethods(name string, fcName string, fc *ast.FuncDecl, reWrite bool)
- func (a *Ast) AddStructWithFields(name string, fields ...*ast.Field) error
- func (a *Ast) AppendStmtInMethod(t ast.Stmt, fc *ast.FuncDecl, keywords ...string)
- func (a *Ast) Dump(fPath string) error
- func (a *Ast) GetAllStructs() []*SimpleStruct
- func (a *Ast) GetMethod(fcName string) *ast.FuncDecl
- func (a *Ast) Inspect(fn func(ast.Node) bool)
- type SimpleStruct
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewAstField ¶
func OpenAbsFile ¶
Types ¶
type Ast ¶
func NewEmptyAst ¶
func (*Ast) AddStructMethods ¶
add or replace struct methods
func (*Ast) AddStructWithFields ¶
func (*Ast) AppendStmtInMethod ¶
func (*Ast) GetAllStructs ¶
func (a *Ast) GetAllStructs() []*SimpleStruct
type SimpleStruct ¶
Click to show internal directories.
Click to hide internal directories.