Import package as a dependency.
go get github.com/ceryspinch/golinter
Call golinter.RunLinter from the main function.
import "github.com/ceryspinch/golinter"
func main() {
golinter.RunLinter()
}
When running your code, add -- filenametolint.go
after go run main.go
to specify the file you want to lint
or add -- ./...
to lint all files in the project.
go run main.go -- example.go
Results output to the command line are colour coded as follows
Red => explanation of what exactly the issue is
Blue => explanation of why the issue may be problematic
Yellow => suggestion for improvement