| 1 |
--- |
| 2 |
title: Staticcheck |
| 3 |
--- |
| 4 |
|
| 5 |
|
| 6 |
{{< blocks/lead type="section" color="primary" >}} |
| 7 |
<img style="height: auto; width: auto; max-height: 300px; max-width: 100%" src="/img/logo.svg" alt="Our mascot, the engineer" /> |
| 8 |
|
| 9 |
Staticcheck is a state of the art linter for the Go programming language. |
| 10 |
Using static analysis, it finds bugs and performance issues, offers simplifications, and enforces style rules. |
| 11 |
|
| 12 |
|
| 13 |
<div class="mx-auto"> |
| 14 |
<a class="btn btn-lg btn-secondary mr-3 mb-4" href="{{< relref "/docs" >}}"> |
| 15 |
Get started <i class="fas fa-arrow-alt-circle-right ml-2"></i> |
| 16 |
</a> |
| 17 |
</div> |
| 18 |
{{< /blocks/lead >}} |
| 19 |
|
| 20 |
{{< blocks/section color="white" >}} |
| 21 |
|
| 22 |
{{% blocks/feature title="Correctness" icon="fa-check" %}} |
| 23 |
Code obviously has to be correct. Unfortunately, it never |
| 24 |
is. Some code is more correct than other, but there'll |
| 25 |
always be bugs. Tests catch some, your peers catch others, |
| 26 |
and Staticcheck catches some more. |
| 27 |
{{% /blocks/feature %}} |
| 28 |
|
| 29 |
|
| 30 |
{{% blocks/feature title="Simplicity" icon="fa-circle" %}} |
| 31 |
After correctness comes simplicity. There are many ways to |
| 32 |
skin a cat (but please don't), but some are unnecessarily |
| 33 |
elaborate. Staticcheck helps you replace complex code with |
| 34 |
simple code. |
| 35 |
{{% /blocks/feature %}} |
| 36 |
|
| 37 |
{{% blocks/feature title="Maintainability" icon="fa-screwdriver" %}} |
| 38 |
Code is a living thing. If it's not maintained regularly, |
| 39 |
it will become stale and unreliable. It won't catch up |
| 40 |
when its dependencies move on or guidelines change. |
| 41 |
Staticcheck is like a sitter for your code for when you |
| 42 |
don't have time. |
| 43 |
{{% /blocks/feature %}} |
| 44 |
|
| 45 |
|
| 46 |
{{% blocks/feature title="Exhaustiveness" icon="fas fa-tasks" url="/docs/checks" %}} |
| 47 |
More than |
| 48 |
{{< numchecks.inline >}} |
| 49 |
{{- $c := len $.Site.Data.checks.Checks -}} |
| 50 |
{{- sub $c (mod $c 25) -}} |
| 51 |
{{< /numchecks.inline >}} |
| 52 |
checks ensure that your code is in tip-top shape. |
| 53 |
{{% /blocks/feature %}} |
| 54 |
|
| 55 |
|
| 56 |
{{% blocks/feature title="Integration" icon="fab fa-github" %}} |
| 57 |
Staticcheck can easily be integrated with your code review and CI systems, preventing buggy code from ever getting committed. |
| 58 |
{{% /blocks/feature %}} |
| 59 |
|
| 60 |
|
| 61 |
{{% blocks/feature title="Editor integration" icon="fa-i-cursor" url="https://github.com/golang/tools/blob/master/gopls/doc/settings.md#staticcheck-bool" %}} |
| 62 |
Staticcheck is part of most major Go editors and has been integrated with gopls, finding bugs and offering automatic fixes. |
| 63 |
{{% /blocks/feature %}} |
| 64 |
|
| 65 |
|
| 66 |
{{< /blocks/section >}} |
| 67 |
|
| 68 |
<link rel="prefetch" href="/docs/"> |