Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

go-critic

> 开发工具
Open source

The most opinionated Go source code linter for code audit.

2.1K stars0 likes1 views
WebsiteGitHub

About

The most opinionated Go source code linter for code audit.

go-critic

Go Report Card coverage PRs Welcome

Highly extensible Go source code linter providing checks currently missing from other linters.

There is never too much static code analysis. Try it out.

Features

  • Almost 100 diagnostics that check for bugs, performance and style issues
  • Extensible without re-compilation with dynamic rules
  • Includes #opinionated checks with very strict and specific requirements
  • Self-documented: go-critic doc <checkname> gives a checker description

Documentation

The latest documentation is available at go-critic.com.

Installation

For most users, using go-critic under golangci-lint is enough.

Precompiled go-critic binaries can be found at releases page.

It can be installed in the usual Go way by running:

bash
go install -v github.com/go-critic/go-critic/cmd/go-critic@latest

To build go-critic from sources, clone this repository and run make go-critic.

On macOS, you can also install go-critic using either Homebrew or MacPorts:

Homebrew

bash
brew install go-critic

MacPorts

bash
sudo port install go-critic

Usage

Be sure go-critic executable is under your $PATH.

Usage of go-critic: go-critic [sub-command] [sub-command args...] Run go-critic without arguments to get help output.

Supported sub-commands:
	check - run linter over specified targets
		$ go-critic check -help
		$ go-critic check -v -enable='paramTypeCombine,unslice' strings bytes
		$ go-critic check -v -enable='#diagnostic' -disable='#experimental,#opinionated' ./...
	version - print linter version
		$ go-critic version
	doc - get installed checkers documentation
		$ go-critic doc -help
		$ go-critic doc
		$ go-critic doc checkerName

check sub-command examples:

…

To get a list of available checker parameters, run go-critic doc <checkerName>.

In place of a single name, tag can be used. Tag is a named checkers group.

Tags:

  • #diagnostic - kind of checks that detect various errors in code
  • #style - kind of checks that find style issues in code
  • #performance - kind of checks that detect potential performance issues in code
  • #experimental - check is under testing and development. Disabled by default
  • #opinionated - check can be unwanted for some people. Disabled by default
  • #security - kind of checks that find security issues in code. Disabled by default and empty, so will fail if enabled.

Contributing

This project aims to be contribution-friendly.

Our chats: English or Russian (Telegram website)

We're using an optimistic merging strategy most of the time. In short, this means that if your contribution has some flaws, we can still merge it and then fix them by ourselves. Experimental and work-in-progress checkers are isolated, so nothing bad will happen.

Code style is the same as in Go project, see CodeReviewComments.

See CONTRIBUTING.md for more details. It also describes how to develop a new checker for the linter.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goconventionsgogo-lintpackgolang

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具