| 1 |
--- |
| 2 |
title: "Welcome to Staticcheck" |
| 3 |
linkTitle: "Documentation" |
| 4 |
menu: |
| 5 |
main: |
| 6 |
weight: 1 |
| 7 |
pre: <i class='fas fa-book'></i> |
| 8 |
--- |
| 9 |
|
| 10 |
Staticcheck is a state of the art linter for the [Go programming language](https://go.dev/). |
| 11 |
Using static analysis, it finds bugs and performance issues, offers simplifications, and enforces style rules. |
| 12 |
|
| 13 |
|
| 14 |
Each of the |
| 15 |
[ |
| 16 |
{{< numchecks.inline >}} |
| 17 |
{{- $c := len $.Site.Data.checks.Checks -}} |
| 18 |
{{- sub $c (mod $c 25) -}} |
| 19 |
{{< /numchecks.inline >}}+ |
| 20 |
]({{< relref "/docs/checks" >}}) checks has been designed to be fast, precise and useful. |
| 21 |
When Staticcheck flags code, you can be sure that it isn't wasting your time with unactionable warnings. |
| 22 |
Unlike many other linters, Staticcheck focuses on checks that produce few to no false positives. |
| 23 |
It's the ideal candidate for running in CI without risking spurious failures. |
| 24 |
|
| 25 |
Staticcheck aims to be trivial to adopt. |
| 26 |
It behaves just like the official `go` tool and requires no learning to get started with. |
| 27 |
Just run `staticcheck ./...` on your code in addition to `go vet ./...`. |
| 28 |
|
| 29 |
While checks have been designed to be useful out of the box, |
| 30 |
they still provide [configuration]({{< relref "/docs/configuration" >}}) where necessary, to fine-tune to your needs, without overwhelming you with hundreds of options. |
| 31 |
|
| 32 |
Staticcheck can be used from the command line, in CI, |
| 33 |
and even [directly from your editor](https://github.com/golang/tools/blob/master/gopls/doc/settings.md#staticcheck-bool). |
| 34 |
|
| 35 |
|
| 36 |
Staticcheck is open source and offered completely free of charge. [Sponsors]({{< relref "/sponsors" >}}) guarantee its continued development. |
| 37 |
|
| 38 |
<link rel="prefetch" href="{{< relref "/docs/getting-started" >}}"> |