Documentation ¶
Index ¶
- func CompositeLitContainsAnyField(cl *ast.CompositeLit, fieldNames ...string) bool
- func CompositeLitField(cl *ast.CompositeLit, fieldName string) *ast.KeyValueExpr
- func CompositeLitFieldBoolValue(cl *ast.CompositeLit, fieldName string) *bool
- func CompositeLitFieldExprValue(cl *ast.CompositeLit, fieldName string) *ast.Expr
- func CompositeLitFieldIntValue(cl *ast.CompositeLit, fieldName string) *int
- func CompositeLitFields(cl *ast.CompositeLit) map[string]*ast.KeyValueExpr
- func ExprBoolValue(e ast.Expr) *bool
- func ExprIntValue(e ast.Expr) *int
- func ExprStringValue(e ast.Expr) *string
- func ExprValue(e ast.Expr) *ast.Expr
- func FieldListName(fieldList *ast.FieldList, fieldPosition int, namePosition int) *string
- func FieldListNames(fieldList *ast.FieldList, position int) []*ast.Ident
- func FieldListType(fieldList *ast.FieldList, position int) *ast.Expr
- func FuncTypeFromNode(node ast.Node) *ast.FuncType
- func IsExprTypeArrayError(e ast.Expr) bool
- func IsExprTypeArrayString(e ast.Expr) bool
- func IsExprTypeError(e ast.Expr) bool
- func IsExprTypeInterface(e ast.Expr) bool
- func IsExprTypeString(e ast.Expr) bool
- func IsFieldListType(fieldList *ast.FieldList, position int, exprFunc func(ast.Expr) bool) bool
- func IsFieldListTypePackageType(fieldList *ast.FieldList, position int, info *types.Info, packageSuffix string, ...) bool
- func IsPackageFunc(e ast.Expr, info *types.Info, packageSuffix string, funcName string) bool
- func IsPackageFunctionFieldListType(e ast.Expr, info *types.Info, packageSuffix string, typeName string) bool
- func IsPackageNamedType(t *types.Named, packageSuffix string, typeName string) bool
- func IsPackageReceiverMethod(e ast.Expr, info *types.Info, packageSuffix string, ...) bool
- func IsPackageType(t types.Type, packageSuffix string, typeName string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompositeLitContainsAnyField ¶
func CompositeLitContainsAnyField(cl *ast.CompositeLit, fieldNames ...string) bool
func CompositeLitField ¶
func CompositeLitField(cl *ast.CompositeLit, fieldName string) *ast.KeyValueExpr
func CompositeLitFieldBoolValue ¶
func CompositeLitFieldBoolValue(cl *ast.CompositeLit, fieldName string) *bool
func CompositeLitFieldExprValue ¶
func CompositeLitFieldExprValue(cl *ast.CompositeLit, fieldName string) *ast.Expr
func CompositeLitFieldIntValue ¶
func CompositeLitFieldIntValue(cl *ast.CompositeLit, fieldName string) *int
func CompositeLitFields ¶
func CompositeLitFields(cl *ast.CompositeLit) map[string]*ast.KeyValueExpr
func ExprBoolValue ¶
ExprBoolValue fetches a bool value from the Expr If the Expr cannot parse as a bool, returns nil.
func ExprIntValue ¶
ExprIntValue fetches an int value from the Expr If the Expr cannot parse as an int, returns nil.
func ExprStringValue ¶
ExprStringValue fetches a string value from the Expr If the Expr is not BasicLit, returns an empty string.
func FieldListName ¶
FieldListName returns field name at field position and name position if found
func FieldListNames ¶
FieldListNames returns field names at field position if found
func FieldListType ¶
FieldListType returns type at field position if found
func IsExprTypeArrayError ¶ added in v0.12.0
IsExprTypeArrayError returns true if the expression matches []error
func IsExprTypeArrayString ¶ added in v0.12.0
IsExprTypeArrayString returns true if the expression matches []string
func IsExprTypeError ¶ added in v0.12.0
IsExprTypeError returns true if the expression matches string
func IsExprTypeInterface ¶ added in v0.12.0
IsExprTypeInterface returns true if the expression matches interface{}
func IsExprTypeString ¶ added in v0.12.0
IsExprTypeString returns true if the expression matches string
func IsFieldListType ¶
IsFieldListType returns true if the field at position is present and matches expected ast.Expr
func IsFieldListTypePackageType ¶
func IsFieldListTypePackageType(fieldList *ast.FieldList, position int, info *types.Info, packageSuffix string, typeName string) bool
IsFieldListTypePackageType returns true if the field at position is present and matches expected package type
func IsPackageFunc ¶
IsPackageFunc returns true if the function package suffix (for vendoring) and name matches
func IsPackageFunctionFieldListType ¶
func IsPackageFunctionFieldListType(e ast.Expr, info *types.Info, packageSuffix string, typeName string) bool
IsPackageFunctionFieldListType returns true if the function parameter package suffix (for vendoring) and name matches
func IsPackageNamedType ¶
IsPackageNamedType returns if the type name matches and is from the package suffix
Types ¶
This section is empty.