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

go-tools

> 开发工具
Open source

Staticcheck - The advanced Go linter

6.8K stars0 likes1 views
WebsiteGitHub

About

Staticcheck - The advanced Go linter

Staticcheck is a state of the art linter for the Go programming language. Using static analysis, it finds bugs and performance issues, offers simplifications, and enforces style rules.

Financial support by private and corporate sponsors guarantees the tool's continued development. Please become a sponsor if you or your company rely on Staticcheck.

Documentation

You can find extensive documentation on Staticcheck on its website.

Installation

Releases

It is recommended that you run released versions of the tools. These releases can be found as git tags (e.g. 2022.1).

The easiest way of installing a release is by using go install, for example go install honnef.co/go/tools/cmd/[email protected]. Alternatively, we also offer prebuilt binaries.

You can find more information about installation and releases in the documentation.

Master

You can also run the master branch instead of a release. Note that while the master branch is usually stable, it may still contain new checks or backwards incompatible changes that break your build. By using the master branch you agree to become a beta tester.

Tools

All of the following tools can be found in the cmd/ directory. Each tool is accompanied by its own README, describing it in more detail.

Tool Description
staticcheck Go static analysis, detecting bugs, performance issues, and much more.
structlayout Displays the layout (field sizes and padding) of structs.
structlayout-optimize Reorders struct fields to minimize the amount of padding.
structlayout-pretty Formats the output of structlayout with ASCII art.

Libraries

In addition to the aforementioned tools, this repository contains the libraries necessary to implement these tools.

Unless otherwise noted, none of these libraries have stable APIs. Their main purpose is to aid the implementation of the tools. You'll have to expect semiregular backwards-incompatible changes if you decide to use these libraries.

System requirements

Staticcheck can be compiled and run with the latest release of Go. It can analyze code targeting any version of Go upto the latest release.

Issues· 578 open

View all issuesOpen on GitHub
  • #1746

    SA4023 panic: index out of range — objectpath method indices desync when a type has a generic method

    Updated Sep 15, 2026
  • #1741

    panic: runtime error: invalid memory address or nil pointer dereference

    bugUpdated Sep 14, 2026
  • #1744

    SA9005 does not understand json/v2 custom marshaling

    false-positiveneeds-triageUpdated Sep 8, 2026
  • #1743

    Weird SA1019 false positive with generic method and another deprecated

    bugfalse-positiveUpdated Sep 8, 2026
  • #793

    Please include support for zerolog Panic (nil pointer check)

    false-positiveUpdated Jun 18, 2026
  • #1719

    SA1012: false positive when calling method expression

    false-positiveUpdated Jun 15, 2026
  • #785

    Unused unexported methods/others.

    Updated May 31, 2026
  • #204

    unused: add flag for checking generated files

    enhancementUpdated May 31, 2026
  • #1712

    SA1026: false positive for nil pointer to struct containing unsupported type

    false-positiveUpdated May 2, 2026
  • #1714

    Check append forms of binary.ByteOrder

    needs-decisionfalse-negativeUpdated Apr 21, 2026

> Tags

Golinterlinterssponsorstatic-analysis

No comments yet. Be the first to share.

> Details

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

> Related tools

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