simple

package
v0.0.0-...-ff0a6c6 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package simple contains a linter for Go source code.

Index

Constants

This section is empty.

Variables

View Source
var Funcs = map[string]lint.Func{
	"S1000": LintSingleCaseSelect,
	"S1001": LintLoopCopy,
	"S1002": LintIfBoolCmp,
	"S1003": LintStringsContains,
	"S1004": LintBytesCompare,
	"S1005": LintRanges,
	"S1006": LintForTrue,
	"S1007": LintRegexpRaw,
	"S1008": LintIfReturn,
	"S1009": LintRedundantNilCheckWithLen,
	"S1010": LintSlicing,
	"S1011": LintLoopAppend,
	"S1012": LintTimeSince,
	"S1013": LintSimplerReturn,
	"S1014": LintReceiveIntoBlank,
	"S1015": LintFormatInt,
	"S1016": LintSimplerStructConversion,
	"S1017": LintTrim,
	"S1018": LintLoopSlide,
	"S1019": LintMakeLenCap,
	"S1020": LintAssertNotNil,
	"S1021": LintDeclareAssign,
}

Functions

func LintAssertNotNil

func LintAssertNotNil(f *lint.File)

func LintBytesCompare

func LintBytesCompare(f *lint.File)

func LintDeclareAssign

func LintDeclareAssign(f *lint.File)

func LintForTrue

func LintForTrue(f *lint.File)

func LintFormatInt

func LintFormatInt(f *lint.File)

func LintIfBoolCmp

func LintIfBoolCmp(f *lint.File)

func LintIfReturn

func LintIfReturn(f *lint.File)

func LintLoopAppend

func LintLoopAppend(f *lint.File)

func LintLoopCopy

func LintLoopCopy(f *lint.File)

func LintLoopSlide

func LintLoopSlide(f *lint.File)

func LintMakeLenCap

func LintMakeLenCap(f *lint.File)

func LintRanges

func LintRanges(f *lint.File)

func LintReceiveIntoBlank

func LintReceiveIntoBlank(f *lint.File)

func LintRedundantNilCheckWithLen

func LintRedundantNilCheckWithLen(f *lint.File)

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 LintRegexpRaw

func LintRegexpRaw(f *lint.File)

func LintSimplerReturn

func LintSimplerReturn(f *lint.File)

func LintSimplerStructConversion

func LintSimplerStructConversion(f *lint.File)

func LintSingleCaseSelect

func LintSingleCaseSelect(f *lint.File)

func LintSlicing

func LintSlicing(f *lint.File)

func LintStringsContains

func LintStringsContains(f *lint.File)

func LintTimeSince

func LintTimeSince(f *lint.File)

func LintTrim

func LintTrim(f *lint.File)

Types

type Checker

type Checker struct {
	CheckGenerated bool
}

func NewChecker

func NewChecker() *Checker

func (*Checker) Funcs

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

func (*Checker) Init

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

Jump to

Keyboard shortcuts

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