package astutil
import "honnef.co/go/tools/go/ast/astutil"
Index ¶
- func Apply(root ast.Node, pre, post ApplyFunc) (result ast.Node)
- func CopyExpr(node ast.Expr) (ast.Expr, bool)
- func Equal(a, b ast.Node) bool
- func GroupSpecs(fset *token.FileSet, specs []ast.Spec) [][]ast.Spec
- func IsBlank(id ast.Expr) bool
- func IsIdent(expr ast.Expr, ident string) bool
- func IsIntLiteral(expr ast.Expr, literal string) bool
- func IsZero(expr ast.Expr) bool
- func NegateDeMorgan(expr ast.Expr, recursive bool) ast.Expr
- func PathEnclosingInterval(root *ast.File, start, end token.Pos) (path []ast.Node, exact bool)
- func Preamble(f *ast.File) string
- func SimplifyParentheses(node ast.Expr) ast.Expr
- func Unparen(e ast.Expr) ast.Expr
- type ApplyFunc
- type Cursor
Functions ¶
func Apply ¶
func CopyExpr ¶
CopyExpr creates a deep copy of an expression. It doesn't support copying FuncLits and returns ok == false when encountering one.
func Equal ¶
func GroupSpecs ¶
func IsBlank ¶
isBlank returns whether id is the blank identifier "_". If id == nil, the answer is false.
func IsIdent ¶
func IsIntLiteral ¶
Deprecated: use code.IsIntegerLiteral instead.
func IsZero ¶
Deprecated: use IsIntLiteral instead
func NegateDeMorgan ¶
func PathEnclosingInterval ¶
func Preamble ¶
func SimplifyParentheses ¶
func Unparen ¶
Unparen returns e with any enclosing parentheses stripped.
Types ¶
type ApplyFunc ¶
type Cursor ¶
Source Files ¶
upstream.go util.go
- Version
- v0.6.0-0.dev
- Published
- Aug 13, 2024
- Platform
- windows/amd64
- Imports
- 7 packages
- Last checked
- 16 minutes ago –
Tools for package owners.