rafttio / linters

Custom linters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raftt

CI

Raftt linters

This package contains Go linters for use in Raftt projects.

Linters

discardedreturn

This linter checks for discarded return values from functions:

func foo() func() {
    ...
}

 
foo()         // error: call discards return value
_ = foo()     // OK
defer foo()   // error: call discards return value
defer foo()() // OK

by default, the linter ignores basic types (e.g integers, bools) and errors.

Running

You can build the golangci-lint plugin by running go build -buildmode=plugin golangci-lint/plugin.go.

You can use the supplied Dockerfile to build and run the linter, or

go run cmd/all/main.go

About

Custom linters


Languages

Language:Go 95.3%Language:Dockerfile 4.7%