simpler

package
v0.0.0-...-14bc36d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package simpler contains a linter for Go source code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Simpler

func Simpler(projectPath map[string]string) []string

Types

type Checker

type Checker struct {
	CheckGenerated bool
	MS             *typeutil.MethodSetCache
	// contains filtered or unexported fields
}

func NewChecker

func NewChecker() *Checker

func (*Checker) Funcs

func (c *Checker) Funcs() map[string]lint.Func

func (*Checker) Implements

func (c *Checker) Implements(j *lint.Job, typ types.Type, iface string) bool

func (*Checker) Init

func (c *Checker) Init(prog *lint.Program)

func (*Checker) LintAssertNotNil

func (c *Checker) LintAssertNotNil(j *lint.Job)

func (*Checker) LintBlankOK

func (c *Checker) LintBlankOK(j *lint.Job)

func (*Checker) LintBytesBufferConversions

func (c *Checker) LintBytesBufferConversions(j *lint.Job)

func (*Checker) LintBytesCompare

func (c *Checker) LintBytesCompare(j *lint.Job)

func (*Checker) LintDeclareAssign

func (c *Checker) LintDeclareAssign(j *lint.Job)

func (*Checker) LintErrorsNewSprintf

func (c *Checker) LintErrorsNewSprintf(j *lint.Job)

func (*Checker) LintForTrue

func (c *Checker) LintForTrue(j *lint.Job)

func (*Checker) LintFormatInt

func (c *Checker) LintFormatInt(j *lint.Job)

func (*Checker) LintIfBoolCmp

func (c *Checker) LintIfBoolCmp(j *lint.Job)

func (*Checker) LintIfReturn

func (c *Checker) LintIfReturn(j *lint.Job)

func (*Checker) LintLoopAppend

func (c *Checker) LintLoopAppend(j *lint.Job)

func (*Checker) LintLoopCopy

func (c *Checker) LintLoopCopy(j *lint.Job)

func (*Checker) LintLoopSlide

func (c *Checker) LintLoopSlide(j *lint.Job)

func (*Checker) LintMakeLenCap

func (c *Checker) LintMakeLenCap(j *lint.Job)

func (*Checker) LintRangeStringRunes

func (c *Checker) LintRangeStringRunes(j *lint.Job)

func (*Checker) LintRanges

func (c *Checker) LintRanges(j *lint.Job)

func (*Checker) LintReceiveIntoBlank

func (c *Checker) LintReceiveIntoBlank(j *lint.Job)

func (*Checker) LintRedundantBreak

func (c *Checker) LintRedundantBreak(j *lint.Job)

func (*Checker) LintRedundantNilCheckWithLen

func (c *Checker) LintRedundantNilCheckWithLen(j *lint.Job)

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 (c *Checker) LintRedundantReturn(j *lint.Job)

func (*Checker) LintRedundantSprintf

func (c *Checker) LintRedundantSprintf(j *lint.Job)

func (*Checker) LintRegexpRaw

func (c *Checker) LintRegexpRaw(j *lint.Job)

func (*Checker) LintSimplerReturn

func (c *Checker) LintSimplerReturn(j *lint.Job)

func (*Checker) LintSimplerStructConversion

func (c *Checker) LintSimplerStructConversion(j *lint.Job)

func (*Checker) LintSingleCaseSelect

func (c *Checker) LintSingleCaseSelect(j *lint.Job)

func (*Checker) LintSlicing

func (c *Checker) LintSlicing(j *lint.Job)

func (*Checker) LintStringCopy

func (c *Checker) LintStringCopy(j *lint.Job)

func (*Checker) LintStringsContains

func (c *Checker) LintStringsContains(j *lint.Job)

func (*Checker) LintTimeSince

func (c *Checker) LintTimeSince(j *lint.Job)

func (*Checker) LintTimeUntil

func (c *Checker) LintTimeUntil(j *lint.Job)

func (*Checker) LintTrim

func (c *Checker) LintTrim(j *lint.Job)

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.
ssa
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL