Documentation ¶
Index ¶
- Constants
- func GetKubebuilderDefault(field *ast.Field) (string, error)
- func HasDocComment(field *ast.Field, substring string) bool
- func ImportSpec(file *ast.File, pkg string) *ast.ImportSpec
- func PointerType(type_ ast.Expr) bool
- func Report(pass *analysis.Pass, pos token.Pos, analyzerName string, format string, ...)
- type BaseLinter
- type FileLinter
Constants ¶
View Source
const (
KubebuilderDefault = "+kubebuilder:default"
)
Variables ¶
This section is empty.
Functions ¶
func GetKubebuilderDefault ¶ added in v0.4.0
func HasDocComment ¶
HasDocComment returns true if the field has a doc comment containting the substring
func ImportSpec ¶
func ImportSpec(file *ast.File, pkg string) *ast.ImportSpec
func PointerType ¶ added in v0.4.0
PointerType returns true if the type is a pointer
Types ¶
type BaseLinter ¶
type BaseLinter struct { FileLinter *analysis.Analyzer Pass *analysis.Pass // contains filtered or unexported fields }
func NewBaseLinter ¶
func NewBaseLinter(Name string, Doc string, l FileLinter) *BaseLinter
func (*BaseLinter) ExprLastName ¶ added in v0.4.0
func (l *BaseLinter) ExprLastName(expr ast.Expr) string
ExprLastName returns the last segment of the name of the expression. I..e "a.b.c()" result in "c". If the expression is not constructed as a Selector / Ident tree then it returns "".
func (*BaseLinter) ExprName ¶ added in v0.4.0
func (l *BaseLinter) ExprName(expr ast.Expr) string
ExprName returns the expression as a name. I.e. "a.b.c()"" will result in "a.b.c" and x() will result in "x". If expression is not constructed as a Selector / Ident tree then it returns "".
type FileLinter ¶
Click to show internal directories.
Click to hide internal directories.