| 1 |
--- |
| 2 |
title: "Frequently Asked Questions" |
| 3 |
--- |
| 4 |
|
| 5 |
|
| 6 |
{{% faq/list %}} |
| 7 |
{{% faq/question id="false-positives" question="Staticcheck is wrong, what should I do?" %}} |
| 8 |
First, make sure that Staticcheck is actually wrong. |
| 9 |
It can find very subtle bugs, and what may look like a false positive at first glance is usually a genuine bug. |
| 10 |
There is a long list of competent programmers |
| 11 |
[who got it wrong before.](https://github.com/dominikh/go-tools/issues?q=is%3Aissue+label%3Afalse-positive+label%3Ainvalid+is%3Aclosed) |
| 12 |
|
| 13 |
However, sometimes Staticcheck _is_ wrong and you want to suppress a warning to get on with your work. |
| 14 |
In that case, you can use [ignore directives to ignore specific problems]({{< relref "/docs/configuration/#ignoring-problems" >}}). |
| 15 |
You should also [report the false positive](https://github.com/dominikh/go-tools/issues/new?assignees=&labels=false-positive%2C+needs-triage&template=1_false_positive.md&title=) so that we can fix it. |
| 16 |
We don't expect users to have to ignore many problems, and we always aim to avoid false positives. |
| 17 |
|
| 18 |
Some checks, particularly those in the `ST` (stylecheck) category, may not be applicable to your code base at all. In that case, you should disable the check using the |
| 19 |
[`checks` option]({{< relref "/docs/configuration/options#checks" >}}) |
| 20 |
in your [configuration]({{< relref "/docs/configuration/#configuration-files" >}}). |
| 21 |
{{% /faq/question %}} |
| 22 |
|
| 23 |
{{% faq/question id="go-version" question="Staticcheck's suggestions don't apply to my version of Go" %}} |
| 24 |
You can [specify the version of Go your code should work with.]({{< relref "/docs/configuration/#targeting-go-versions" >}}) |
| 25 |
{{% /faq/question %}} |
| 26 |
{{% /faq/list %}} |