Documentation ¶
Overview ¶
Package simpler contains a linter for Go source code.
Index ¶
- func Simpler(projectPath map[string]string) []string
- type Checker
- func (c *Checker) Funcs() map[string]lint.Func
- func (c *Checker) Implements(j *lint.Job, typ types.Type, iface string) bool
- func (c *Checker) Init(prog *lint.Program)
- func (c *Checker) LintAssertNotNil(j *lint.Job)
- func (c *Checker) LintBlankOK(j *lint.Job)
- func (c *Checker) LintBytesBufferConversions(j *lint.Job)
- func (c *Checker) LintBytesCompare(j *lint.Job)
- func (c *Checker) LintDeclareAssign(j *lint.Job)
- func (c *Checker) LintErrorsNewSprintf(j *lint.Job)
- func (c *Checker) LintForTrue(j *lint.Job)
- func (c *Checker) LintFormatInt(j *lint.Job)
- func (c *Checker) LintIfBoolCmp(j *lint.Job)
- func (c *Checker) LintIfReturn(j *lint.Job)
- func (c *Checker) LintLoopAppend(j *lint.Job)
- func (c *Checker) LintLoopCopy(j *lint.Job)
- func (c *Checker) LintLoopSlide(j *lint.Job)
- func (c *Checker) LintMakeLenCap(j *lint.Job)
- func (c *Checker) LintRangeStringRunes(j *lint.Job)
- func (c *Checker) LintRanges(j *lint.Job)
- func (c *Checker) LintReceiveIntoBlank(j *lint.Job)
- func (c *Checker) LintRedundantBreak(j *lint.Job)
- func (c *Checker) LintRedundantNilCheckWithLen(j *lint.Job)
- func (c *Checker) LintRedundantReturn(j *lint.Job)
- func (c *Checker) LintRedundantSprintf(j *lint.Job)
- func (c *Checker) LintRegexpRaw(j *lint.Job)
- func (c *Checker) LintSimplerReturn(j *lint.Job)
- func (c *Checker) LintSimplerStructConversion(j *lint.Job)
- func (c *Checker) LintSingleCaseSelect(j *lint.Job)
- func (c *Checker) LintSlicing(j *lint.Job)
- func (c *Checker) LintStringCopy(j *lint.Job)
- func (c *Checker) LintStringsContains(j *lint.Job)
- func (c *Checker) LintTimeSince(j *lint.Job)
- func (c *Checker) LintTimeUntil(j *lint.Job)
- func (c *Checker) LintTrim(j *lint.Job)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checker ¶
type Checker struct { CheckGenerated bool MS *typeutil.MethodSetCache // contains filtered or unexported fields }
func NewChecker ¶
func NewChecker() *Checker
func (*Checker) Implements ¶
func (*Checker) LintAssertNotNil ¶
func (*Checker) LintBlankOK ¶
func (*Checker) LintBytesBufferConversions ¶
func (*Checker) LintBytesCompare ¶
func (*Checker) LintDeclareAssign ¶
func (*Checker) LintErrorsNewSprintf ¶
func (*Checker) LintForTrue ¶
func (*Checker) LintFormatInt ¶
func (*Checker) LintIfBoolCmp ¶
func (*Checker) LintIfReturn ¶
func (*Checker) LintLoopAppend ¶
func (*Checker) LintLoopCopy ¶
func (*Checker) LintLoopSlide ¶
func (*Checker) LintMakeLenCap ¶
func (*Checker) LintRangeStringRunes ¶
func (*Checker) LintRanges ¶
func (*Checker) LintReceiveIntoBlank ¶
func (*Checker) LintRedundantBreak ¶
func (*Checker) LintRedundantNilCheckWithLen ¶
LintRedundantNilCheckWithLen checks for the following reduntant nil-checks:
if x == nil || len(x) == 0 {} if x != nil && len(x) != 0 {} if x != nil && len(x) == N {} (where N != 0) if x != nil && len(x) > N {} if x != nil && len(x) >= N {} (where N != 0)
func (*Checker) LintRedundantReturn ¶
func (*Checker) LintRedundantSprintf ¶
func (*Checker) LintRegexpRaw ¶
func (*Checker) LintSimplerReturn ¶
func (*Checker) LintSimplerStructConversion ¶
func (*Checker) LintSingleCaseSelect ¶
func (*Checker) LintSlicing ¶
func (*Checker) LintStringCopy ¶
func (*Checker) LintStringsContains ¶
func (*Checker) LintTimeSince ¶
func (*Checker) LintTimeUntil ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package lint provides the foundation for tools like gosimple.
|
Package lint provides the foundation for tools like gosimple. |
lintutil
Package lintutil provides helpers for writing linter command lines.
|
Package lintutil provides helpers for writing linter command lines. |
Package ssa defines a representation of the elements of Go programs (packages, types, functions, variables and constants) using a static single-assignment (SSA) form intermediate representation (IR) for the bodies of functions.
|
Package ssa defines a representation of the elements of Go programs (packages, types, functions, variables and constants) using a static single-assignment (SSA) form intermediate representation (IR) for the bodies of functions. |
Click to show internal directories.
Click to hide internal directories.