Skip to content
49

Awesome Go Linters

A curated list of awesome Go linters. More than 60 linters and tools!

1.1k stars49 forks85 entriesLast push Sep 11, 2021 (5 years ago)License MIT

This page lists names, links and short descriptions. The original list on GitHub is the source and belongs to its authors.

Cloud Linters >Go Focused

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.

In 2 lists

Cloud Linters >General Purpose

CodeClimate

The open and extensible static analysis platform.

In 8 listsDetails

CodeFactor

Automated Code Analysis for repos on GitHub or BitBucket.

In 3 lists

HoundCI

Code review tool for GitHub pull requests

In 7 listsDetails

QuantifiedCode

Automated code review & repair

Scrutinizer

A proprietery code quality checker that can be integrated with GitHub

In 2 lists

SideCI

An automated code reviewing tool. Improving developers' productivity.

Linters >Code Formatting

dedupimport

Fix duplicate imports that have the same import path but different import names.

gofmt

Gofmt formats Go programs. Must have for every project. Don't forget to use -s flag.

In 2 lists

gofumpt

The tool is a modified fork of gofmt, enforcing a stricter format than gofmt, while being backwards compatible.

In 4 listsDetails

goimports

Goimports does everything that gofmt does. Additionally it checks unused imports.

unindent

Report code that is unnecessarily indented

Linters >Code Complexity

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.

In 2 lists

funlen

linter that checks for long functions. It can check both the number of lines and the number of statements.

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.

Linters >Style and Patterns Checking

dogsled

Finds assignments/declarations with too many blank identifiers.

dupl

Tool for code clone detection.

In 3 lists

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.

In 2 lists

go-cleanarch

go-cleanarch was created to validate Clean Architecture rules, like a The Dependency Rule and interaction between packages in your Go projects.

In 3 lists

go-consistent

source code analyzer that helps you to make your Go programs more consistent.

go-namecheck

source code analyzer that helps you to maintain variable/field naming conventions inside your project.

go-printf-func-name

checks that printf-like functions are named with f at the end.

go-ruleguard

Define and run pattern-based custom linting rules.

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.

In 3 lists

GoLint

Golint is a linter for Go source code.

In 3 lists

gosimple

gosimple is a linter for Go source code that specialises on simplifying code.

In 5 listsDetails

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

In 2 lists

nofuncflags

disallow boolean params to functions (flags).

predeclared

Find code that shadows Go's built-in identifiers (e.g., append, copy, int).

revive

~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint

In 4 listsDetails

unconvert

Remove unnecessary type conversions from Go source.

In 3 lists

usedexports

Find in Go exported variables that could be unexported.

whitespace

Checks for unnecessary newlines at the start and end of functions

Linters >Bugs

apicompat

Checks recent changes to a Go project for backwards incompatible changes.

In 2 lists

badtime

Badtime is a Golang linter that detects inappropriate usage of the time.Time struct.

bodyclose

checks whether HTTP response body is closed and a re-use of TCP connection is not blocked

In 2 lists

durcheck

durcheck is a very simple linter which detects potential bugs with time.Duration in a Go package.

enumcase

enumcase checks every switch statement handles all const values of the type.

enumlinter

Enum linter for enumerated types in Go.

errcheck

Errcheck is a program for checking for unchecked errors in Go programs.

In 6 listsDetails

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.

In 2 lists

gosumcheck

Checks all possible cases of type-switch are handled.

go-sumtype

Checks all possible cases of type-switch are handled.

mulint

Go lint which detects recursive locks, which may lead to dead locks.

safesql

Static analysis tool for Golang that protects against SQL injections.

In 2 lists

scopelint

scopelint checks for unpinned variables in go programs.

sqlrows

checks whether Close on sql.Rows is called.

gosimple

gosimple is a linter for Go source code that specialises on simplifying code.

In 5 listsDetails

Linters >Unused Code

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.

In 2 lists

gosimple

gosimple is a linter for Go source code that specialises on simplifying code.

In 5 listsDetails

varcheck

Find unused global variables and constants.

In 2 lists

Linters >Performance

structcheck

Find unused global variables and constants.

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.

In 2 lists

rangerdanger

Tool to detect range statements iterating over addressable arrays

Linters >Reports

flen

Get info on length of functions in a Go package.

In 2 lists

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.

In 2 lists

golinters

golinters generates HTML reports about Go linters.

Linters >Misc

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.

gosimple

gosimple is a linter for Go source code that specialises on simplifying code.

In 5 listsDetails

go-critic

source code linter that brings checks that are currently not implemented in other linters.

In 4 listsDetails

tarp

tarp finds functions and methods without direct unit tests in Go source code.

go-mnd

Magic number detector for Go.

gocheckit

A Go tool to help identify Deprecated Go Modules.

Linters Helper Tools

golangci-lint

Linters Runner for Go. 5x faster than gometalinter. Nice colored output. Can report only new issues. Fewer false-positives. Yaml/toml config.

In 5 listsDetails

gometalinter

Metalinter is a tool to automatically apply all static analysis tool and report their output in normalized form.

In 3 lists

lint

Run linters as part of go test.

In 2 lists

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.

In 2 lists

zb

speedup linting by caching gometalinter result.

golintui

A simple terminal UI for Go linters.

See category
94

Awesome Rust

rust-unofficial/awesome-rust

A curated list of Rust code and resources.

Fresh★ 60k1833 entriesPushed today
94

Awesome Mac

jaywcjlove/awesome-mac

 This project is dedicated to collecting high-quality macOS software and organizing them systematically by different categories for easy search and use.

Fresh★ 115k1316 entriesPushed today
94

Awesome Python

vinta/awesome-python

Curated Python frameworks, libraries and resources.

Fresh★ 324k504 entriesPushed today
94

Awesome C++

fffaraz/awesome-cpp

A curated list of awesome C++ (or C) frameworks, libraries, resources, and shiny things. Inspired by awesome-... stuff.

Fresh★ 74k1358 entriesPushed yesterday
94

Awesome Go

avelino/awesome-go

Curated Go frameworks and libraries.

Fresh★ 186k3119 entriesPushed yesterday
94

Awesome PHP

ziadoz/awesome-php

A curated list of amazingly awesome PHP libraries, resources and shiny things.

Fresh★ 33k87 entriesPushed 2 days ago