A curated list of awesome Go linters.
Sponsored by GolangCI: SaaS service for running linters on Github pull requests. Free for Open Source.
- GolangCI - Open Source SaaS service for running linters on Github pull requests. Free for Open Source.
- Golint online - Lints online Go source files on GitHub, Bitbucket and Google Project Hosting using the golint package.
- GopherCI - GopherCI helps you maintain high-quality Go projects, by checking each GitHub Pull Request, for backward incompatible changes, and a suite of other tests.
- Go Report Card - Go repo report card.
- CodeClimate - The open and extensible static analysis platform.
- CodeFactor - Automated Code Analysis for repos on GitHub or BitBucket.
- HoundCI - Code review tool for GitHub pull requests
- QuantifiedCode - Automated code review & repair
- Scrutinizer - A proprietery code quality checker that can be integrated with GitHub
- SideCI - An automated code reviewing tool. Improving developers' productivity.
- gofmt - Gofmt formats Go programs. Must have for every project. Don't forget to use -s flag.
- goimports - Goimports does everything that gofmt does. Additionally it checks unused imports.
- unindent - Report code that is unnecessarily indented
- abcgo - ABC metrics for Go source code.
- depth - Count the maxdepth of go functions. It's helpful to see if a function needs to be splitted into several smaller functions, for readability purpose.
- gocyclo - Computes and checks the cyclomatic complexity of functions.
- nakedret - nakedret is a Go static analysis tool to find naked returns in functions greater than a specified function length.
- splint - It finds any functions that are too long or have too many parameters or results.
- dupl - Tool for code clone detection.
- go-checkstyle - checkstyle is a style check tool like java checkstyle. This tool inspired by java checkstyle, golint. The style refered to some points in Go Code Review Comments.
- go-cleanarch - go-cleanarch was created to validate Clean Architecture rules, like a The Dependency Rule and interaction between packages in your Go projects.
- gochecknoinits - Find init functions, to reduce side effects in code.
- gochecknoglobals - Find global vars, to reduce side effects in code.
- goconst - Find in Go repeated strings that could be replaced by a constant.
- GoLint - Golint is a linter for Go source code.
- gosimple - gosimple is a linter for Go source code that specialises on simplifying code.
- impi - Verify imports grouping and ordering.
- interfacer - Linter that suggests narrower interface types.
- lll - Line length linter, used to enforce line length in files.
- misspell - Finds commonly misspelled English words
- nofuncflags - disallow boolean params to functions (flags).
- unconvert - Remove unnecessary type conversions from Go source.
- usedexports - Find in Go exported variables that could be unexported.
- apicompat - Checks recent changes to a Go project for backwards incompatible changes.
- badtime - Badtime is a Golang linter that detects inappropriate usage of the time.Time struct.
- durcheck - durcheck is a very simple linter which detects potential bugs with time.Duration in a Go package.
- enumlinter - Enum linter for enumerated types in Go.
- errcheck - Errcheck is a program for checking for unchecked errors in Go programs.
- gas - Inspects source code for security problems by scanning the Go AST.
- go vet - Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string. Can check shadowing of variables, but must be enabled explicitly.
- mulint - Go lint which detects recursive locks, which may lead to dead locks.
- safesql - Static analysis tool for Golang that protects against SQL injections.
- scopelint - scopelint checks for unpinned variables in go programs.
- staticcheck - staticcheck is
go vet
on steroids, applying a ton of static analysis checks you might be used to from tools like ReSharper for C#.
- deadcode - Finds unused code.
- ineffassign - Detect when assignments to existing variables are not used.
- structcheck - Find unused global variables and constants.
- unparam - Report unused function parameters.
- unused - unused checks Go code for unused constants, variables, functions and types.
- varcheck - Find unused global variables and constants.
- aligncheck - Warn about un-optimally aligned structures.
- Copyfighter - Statically analyzes Go code and reports functions that are passing large structs by value.
- maligned - Tool to detect Go structs that would take less memory if their fields were sorted.
- prealloc - Find slice declarations that could potentially be preallocated.
- flen - Get info on length of functions in a Go package.
- GoReporter - A Golang tool that does static analysis, unit testing, code review and generate code quality report.
- golinters - golinters generates HTML reports about Go linters.
- go-outdated - Console application that displays outdated packages.
- go-template-lint - go-template-lint is a linter for Go text/template (and html/template) template files.
- godox - Find all TODO/FIXME comments.
- lingo - Set of specific checks.
- megacheck - megacheck runs staticcheck, gosimple and unused at once. Because it is able to reuse work, it will be faster than running each tool separately.
- go-critic - source code linter that brings checks that are currently not implemented in other linters.
- tarp - tarp finds functions and methods without direct unit tests in Go source code.
- Go Metalinter - Metalinter is a tool to automatically apply all static analysis tool and report their output in normalized form.
- lint - Run linters as part of go test.
- revgrep - Filters output from static analysis tools, showing only recently changed lines of code
- reviewdog - "reviewdog" provides a way to post review comments to code hosting service, such as GitHub, automatically by integrating with any linter tools with ease.
- zb - speedup linting by caching gometalinter result.