Documentation ¶
Index ¶
- func Array(typ ast.Expr, elements []ast.Expr) ast.Expr
- func ArrayType(typ ast.Expr) ast.Expr
- func AssignStmt(variable ast.Expr, value ast.Expr) ast.Stmt
- func BinaryExpr(Op token.Token, first ast.Expr, others ...ast.Expr) ast.Expr
- func BlockStmt(list ...ast.Stmt) *ast.BlockStmt
- func Bool(val bool) ast.Expr
- func Call(name ast.Expr, args []ast.Expr) ast.Expr
- func DefineStmt(variable ast.Expr, value ast.Expr) ast.Stmt
- func DocComment(comments ...string) *ast.CommentGroup
- func ExprStmt(expr ast.Expr) ast.Stmt
- func False() ast.Expr
- func Field(name *ast.Ident, typ ast.Expr) *ast.Field
- func Fields(fields ...*ast.Field) *ast.FieldList
- func Ident(name string) *ast.Ident
- func Int(val int) *ast.BasicLit
- func KeyValue(key string, value ast.Expr) *ast.KeyValueExpr
- func MethodCallExpr(instance ast.Expr, method string, args []ast.Expr) ast.Expr
- func MultiAssignStmt(variables []ast.Expr, value ast.Expr) ast.Stmt
- func MultiDefineStmt(variables []ast.Expr, value ast.Expr) ast.Stmt
- func Nil() *ast.Ident
- func Not(expr ast.Expr) ast.Expr
- func PrintNode(node ast.Node) string
- func RefType(typ ast.Expr) ast.Expr
- func ReturnStmt(results ...ast.Expr) *ast.ReturnStmt
- func String(val string) *ast.BasicLit
- func Struct(fields ...ast.Expr) ast.Expr
- func True() ast.Expr
- func Type(name string) ast.Expr
- func VarDecl(doc *ast.CommentGroup, variable *ast.Ident, value ast.Expr) *ast.GenDecl
- type FileBuilder
- type Imports
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DocComment ¶
func DocComment(comments ...string) *ast.CommentGroup
func MethodCallExpr ¶
func ReturnStmt ¶
func ReturnStmt(results ...ast.Expr) *ast.ReturnStmt
Types ¶
type FileBuilder ¶
type FileBuilder struct {
// contains filtered or unexported fields
}
FileBuilder
func NewFileBuilder ¶
func NewFileBuilder(name string, pkg string) *FileBuilder
func (*FileBuilder) AddDecl ¶
func (b *FileBuilder) AddDecl(decl ast.Decl)
func (*FileBuilder) BuildFile ¶
func (b *FileBuilder) BuildFile() *ast.File
func (*FileBuilder) PkgIdent ¶
func (b *FileBuilder) PkgIdent(pkg string, name string) ast.Expr
expr
func (*FileBuilder) Written ¶
func (b *FileBuilder) Written() bool
Click to show internal directories.
Click to hide internal directories.