Documentation
¶
Index ¶
- Constants
- Variables
- func FindIdentsWithPartialPrefix(prefixSource string, idents []string) (commonPrefix string, found []string)
- func FirstToLower(s string) string
- func FirstToUpper(s string) string
- func FixName(text string) string
- func FixNameFromFuncDecl(fn *ast.FuncDecl) string
- func ForFuncType(n *ast.FuncType) *ast.FieldList
- func ForTypeSpec(n *ast.TypeSpec) *ast.FieldList
- func GetObjectName(node ast.Node) string
- func GetParamsFromFunc(funcType *ast.FuncType) []string
- func GetReturnsFromFunc(funcType *ast.FuncType) []string
- func GetSegmentCount(text string) int
- func GetSegments(ident string) (segments []string)
- func IsGeneric(node ast.Node, info *types.Info) bool
- func IsLower(b byte) bool
- func NewEmbedding() *analysis.Linter
- func NewNoDefer() *analysis.Linter
- func NewNoDoc() *analysis.Linter
- func NewNoGeneric() *analysis.Linter
- func NewNoGoroutine() *analysis.Linter
- func NewNoInit() *analysis.Linter
- func NewNoLength() *analysis.Linter
- func NewNoNoLint() *analysis.Linter
- func NewNoObject() *analysis.Linter
- func NewNoPrefix() *analysis.Linter
- func NewNoUnderscore() *analysis.Linter
- func ReadLine(path string, line int) string
- type BodyVariable
- type EmbeddedFields
- type FuncComment
Constants ¶
View Source
const ( MaxLengthObject = 30 MaxSegmentCount = 6 )
Variables ¶
View Source
var All = []*analysis.Linter{ NewNoGeneric(), NewNoInit(), NewNoGoroutine(), NewNoNoLint(), NewNoDefer(), NewNoLength(), NewNoPrefix(), NewNoUnderscore(), NewNoObject(), NewNoDoc(), NewEmbedding(), }
All lintres for analysis.
Functions ¶
func FirstToLower ¶ added in v0.3.17
func FirstToUpper ¶ added in v0.3.17
func FixNameFromFuncDecl ¶ added in v0.3.19
func GetObjectName ¶
func GetParamsFromFunc ¶ added in v0.4.0
func GetReturnsFromFunc ¶ added in v0.4.0
func GetSegmentCount ¶
func GetSegments ¶
func NewEmbedding ¶ added in v0.8.0
NewEmbedding create instance linter for check embedding.
func NewNoDefer ¶
NewNoDefer create instance linter for check defer.
func NewNoGeneric ¶
NewNoGeneric create instance linter for check generic. Please more info in https://cs.opensource.google/go/x/tools/+/master:go/analysis/passes/usesgenerics/
func NewNoGoroutine ¶
NewNoGoroutine create instance linter for check goroutines.
func NewNoLength ¶
NewNoLength create instance linter for length object.
func NewNoNoLint ¶
NewNoNoLint create instance linter for check func nolint.
func NewNoObject ¶ added in v0.5.0
func NewNoPrefix ¶
NewNoPrefix create instance linter for check func prefix.
func NewNoUnderscore ¶ added in v0.4.0
Types ¶
type BodyVariable ¶ added in v0.4.0
func GetVarFromBody ¶ added in v0.4.0
func GetVarFromBody(block *ast.BlockStmt) []BodyVariable
type EmbeddedFields ¶ added in v0.8.0
EmbeddedFields info about embedded fields.
type FuncComment ¶
func GetCommentsByFunc ¶
func GetCommentsByFunc(fn *ast.FuncDecl, fileComments []*ast.CommentGroup, fset *token.FileSet) []FuncComment
Click to show internal directories.
Click to hide internal directories.