GoLint alternatives and similar packages
Based on the "Code Analysis" category.
Alternatively, view GoLint alternatives based on common mentions on social networks and blogs.
-
Go Metalinter
DISCONTINUED. Metalinter is a tool to automatically apply all static analysis tool and report their output in normalized form. -
revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint -
go-cleanarch
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects. -
go-mod-outdated
Find outdated dependencies of your Go projects. go-mod-outdated provides a table view of the go list -u -m -json all command which lists all dependencies of a Go project and their available minor and patch updates. It also provides a way to filter indirect dependencies and dependencies without updates. -
goreturns
A gofmt/goimports-like tool for Go programmers that fills in Go return statements with zero values to match the func return types -
usestdlibvars
A linter that detect the possibility to use variables/constants from the Go standard library. -
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#. -
Golint online
Lints online Go source files on GitHub, Bitbucket and Google Project Hosting using the golint package. -
blanket
blanket is a tool that helps you catch functions which don't have direct unit tests in your Go packages.
SaaSHub - Software Alternatives and Reviews
Do you think we are missing an alternative of GoLint or a related project?
README
Golint is a linter for Go source code.
Installation
Golint requires a supported release of Go.
go get -u golang.org/x/lint/golint
To find out where golint
was installed you can run go list -f {{.Target}} golang.org/x/lint/golint
. For golint
to be used globally add that directory to the $PATH
environment setting.
Usage
Invoke golint
with one or more filenames, directories, or packages named
by its import path. Golint uses the same
import path syntax as
the go
command and therefore
also supports relative import paths like ./...
. Additionally the ...
wildcard can be used as suffix on relative and absolute file paths to recurse
into them.
The output of this tool is a list of suggestions in Vim quickfix format, which is accepted by lots of different editors.
Purpose
Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes.
Golint differs from govet. Govet is concerned with correctness, whereas golint is concerned with coding style. Golint is in use at Google, and it seeks to match the accepted style of the open source Go project.
The suggestions made by golint are exactly that: suggestions. Golint is not perfect, and has both false positives and false negatives. Do not treat its output as a gold standard. We will not be adding pragmas or other knobs to suppress specific warnings, so do not expect or require code to be completely "lint-free". In short, this tool is not, and will never be, trustworthy enough for its suggestions to be enforced automatically, for example as part of a build process. Golint makes suggestions for many of the mechanically checkable items listed in Effective Go and the CodeReviewComments wiki page.
Scope
Golint is meant to carry out the stylistic conventions put forth in Effective Go and CodeReviewComments. Changes that are not aligned with those documents will not be considered.
Contributions
Contributions to this project are welcome provided they are in scope, though please send mail before starting work on anything major. Contributors retain their copyright, so we need you to fill out a short form before we can accept your contribution.
Vim
Add this to your ~/.vimrc:
set rtp+=$GOPATH/src/golang.org/x/lint/misc/vim
If you have multiple entries in your GOPATH, replace $GOPATH
with the right value.
Running :Lint
will run golint on the current file and populate the quickfix list.
Optionally, add this to your ~/.vimrc
to automatically run golint
on :w
autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow
Emacs
Add this to your .emacs
file:
(add-to-list 'load-path (concat (getenv "GOPATH") "/src/golang.org/x/lint/misc/emacs/"))
(require 'golint)
If you have multiple entries in your GOPATH, replace $GOPATH
with the right value.
Running M-x golint will run golint on the current file.
For more usage, see Compilation-Mode.