Documentation ¶
Index ¶
- func Atoi(s string) int
- func GetExportedName(field string) string
- func InStrings(item string, items []string) bool
- func IsAValidFunctionName(s string) bool
- func NewBinaryExpr(left goast.Expr, operator token.Token, right goast.Expr) *goast.BinaryExpr
- func NewCallExpr(functionName string, args ...goast.Expr) *goast.CallExpr
- func NewExprStmt(expr goast.Expr) *goast.ExprStmt
- func NewFuncClosure(returnType string, stmts ...goast.Stmt) *goast.CallExpr
- func NewIdent(name string) goast.Expr
- func NewIdents(names ...string) []goast.Expr
- func NewIntLit(value int) *goast.BasicLit
- func NewNil() *goast.Ident
- func NewStringLit(value string) *goast.BasicLit
- func ShowDiff(a, b string) string
- func Ucfirst(word string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExportedName ¶ added in v0.9.0
func IsAValidFunctionName ¶ added in v0.12.4
IsAValidFunctionName performs a crude check to see if a string would make a valid function name in Go. Crude because it is not based on the actual Go standard and allows for some special conditions that allow writing code easier.
func NewBinaryExpr ¶ added in v0.11.0
func NewCallExpr ¶ added in v0.11.0
NewCallExpr creates a new *"go/ast".CallExpr with each of the arguments (after the function name) being each of the expressions that represent the individual arguments.
The function name is checked with IsAValidFunctionName and will panic if the function name is deemed to be not valid.
func NewFuncClosure ¶ added in v0.12.4
NewFuncClosure creates a new *"go/ast".CallExpr that calls a function literal closure. The first argument is the Go return type of the closure, and the remainder of the arguments are the statements of the closure body.
func NewStringLit ¶ added in v0.11.0
Types ¶
This section is empty.