Documentation ¶
Index ¶
- func DumpNode(node ast.Node) []byte
- func ExpressionType(pass *analysis.Pass, s ast.Expr) (types.BasicKind, bool)
- func ImportInfo(pass *analysis.Pass, node ast.Node) (alias, path string, ok bool)
- func IsEffectiveIncByOne(ident ast.Expr, inc ast.Stmt) bool
- func IsGenerated(file *ast.File) bool
- func IsLiteralZero(expr ast.Expr) bool
- func IsString(pass *analysis.Pass, s ast.Expr) bool
- func LenOf(pass *analysis.Pass, expr ast.Expr) (ast.Expr, bool)
- func NameToBasicKind(name string) types.BasicKind
- func NamesMatch(x, y ast.Expr) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpressionType ¶
ExpressionType returns the type of the expression s, if it is of a basic type.
func ImportInfo ¶
ImportInfo returns the alias and path of the import referenced by node.
If node is an import spec, the alias is the name of the imported package and the path is the import path. If node is a selector expression, the alias is the package name and the path is the import path. If node is a call expression, the alias is the package name and the path is the import path.
Alais is always populated, either with the package name or the package alias.
If node is not an import spec, selector expression, or call expression, ok is false.
func IsEffectiveIncByOne ¶
IsEffectiveIncByOne returns true if the increment statement is an effective increment by one. This will return true for if inc increments ident with an expression of the form 'i++', 'i += 1' and 'i = i + 1'.
func IsGenerated ¶
IsGenerated returns true if the file is generated.
func IsLiteralZero ¶
IsLiteralZero returns true if expr is a literal zero.
func NameToBasicKind ¶
NameToBasicKind returns the basic kind of the type with the given name.
func NamesMatch ¶
NamesMatch returns true if x and y are of the same type and have the same name.
Types ¶
This section is empty.