Rule Description KPI URL
golint-errorShouldBeLastReturn error should be the last type when returning multiple items Robustness
golint-annoyingUseExportedType exported function returns unexported type, which can be annoying to use. Robustness
golint-ifBlockReturn if block ends with a return statement, so drop this else and outdent its block Accuracy
golint-receiverNameShouldBeConsistent receiver name should be consistent with previous receiver name Robustness
golint-receiverNameShouldBeReflection receiver name should be a reflection of its identity; don’t use generic names such as “this” or “self” Robustness
golint-receiverNameShouldNotBeUnderscore receiver name should not be an underscore, omit the name if it is unused Understandability
golint-dropAssignment should drop = from declaration of var. it is the zero value Understandability
golint-blankImport a blank import should be only in a main or test package, or have a comment justifying it Efficiency
golint-contextContextFirstArg context.Context should be the first parameter of a function Understandability
golint-avoidUnitSpecificSuffix don’t use unit-specific suffix Sec Robustness
golint-packageCommentDetached package comment is detached; there should be no blank lines between it and the package statement Understandability
golint-packageNameStutters Package name stutters. Consider using other names Understandability
golint-avoidBasicTypeAsKey should not use basic type as key in context.WithValue Robustness
vet-printfFormatting Suspicious calls to functions in the Printf family, including any functions with these names, disregarding case:







Print Printf Println
Fprint Fprintf Fprintln
Sprint Sprintf Sprintln
Error Errorf
Fatal Fatalf
Log Logf
Panic Panicf Panicln

The -printfuncs flag can be used to redefine this list. If the function name ends with an ‘f’, the function is assumed to take a format descriptor string in the manner of fmt.Printf. If not, vet complains about arguments that look like format descriptor strings.

It also checks for errors such as using a Writer as the first argument of Printf.

vet-unreachableCode Unreachable code Robustness
vet-shadow Variables that may have been unintentionally shadowed. Maintainability
vet-copyingLock Locks that are erroneously passed by value. Robustness
vet-boolCondError Mistakes involving boolean operators. Accuracy
vet-httpresponseUsedIncorrectly Mistakes deferring a function call on an HTTP response before checking whether the error returned with the response was nil Accuracy
vet-lostcancel The cancelation function returned by context.WithCancel, WithTimeout, and WithDeadline must be called or the new context will remain live until its parent context is cancelled. (The background context is never cancelled.) Robustness
vet-rangeloops Incorrect uses of range loop variables in closures. Accuracy
vet-shiftIncorrect Shifts equal to or longer than the variable’s length. Accuracy
vet-unusedresult Calls to well-known functions and methods that return a value that is discarded. By default, this includes functions like fmt.Errorf and fmt.Sprintf and methods like String and Error. The flags -unusedfuncs and -unusedstringmethods control the set Robustness
gocyclo-cyclomaticComplexity High cyclomatic complexity Efficiency
errcheck-returnValueNotChecked Running errcheck on a package will report all function calls that have unchecked errors. Accuracy
gotype-indexOutOfBounds Index out of bounds Robustness
gotype-incorrectConversion Incorrect conversion of variable Accuracy
gotype-unusedVar Variables declared but not used Maintainability