Skip to content

Commit 311f07d

Browse files
authored
docs: improve typecheck FAQ (#4306)
1 parent 8301163 commit 311f07d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

docs/src/docs/usage/faq.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,27 @@ Usually this options is used during development on local machine and compilation
3535

3636
## Why do you have `typecheck` errors?
3737

38-
`typecheck` is like the front-end of a Go compiler, parses and type-checks Go code, it manages compilation errors.
38+
`typecheck` is like a front-end for the Go compiler errors.
39+
Compilation errors are identified/labeled as reports of `typecheck` but they are not produced by a linter called `typecheck`.
40+
41+
`typecheck` is not a linter, it doesn't perform any analysis,
42+
it's just a way to identify, parse, and display compiling errors (produced by the `types.Checker`) and some linter errors.
3943

4044
It cannot be disabled because of that.
4145

4246
Of course, this is just as good as the compiler itself and a lot of compilation issues will not properly show where in the code your error lies.
4347

44-
`typecheck` is not a real linter, it's just a way to parse compiling errors (produced by the `types.Checker`) and some linter errors.
48+
As a consequence, the code to analyze should compile.
49+
It means that if you try to run an analysis on a single file or a group of files or a package or a group of packages,
50+
with dependencies on other files or packages of your project, as it doesn't compile (because of the missing pieces of code),
51+
it also cannot be analyzed.
4552

46-
If there are `typecheck` errors, golangci-lint will not able to produce other reports because that kind of error doesn't allow it to perform analysis.
53+
If there are `typecheck` errors, golangci-lint will not able to produce other reports because that kind of error doesn't allow it to perform any analysis.
4754

4855
How to troubleshoot:
4956

5057
- [ ] Ensure the version of `golangci-lint` is built with a compatible version of Go.
5158
- [ ] Ensure dependencies are up-to-date with `go mod tidy`.
5259
- [ ] Ensure building works with `go run ./...`/`go build ./...` - whole package.
60+
- [ ] Ensure you are not running an analysis on code that depends on files/packages outside the scope of the analyzed elements.
5361
- [ ] If using CGO, ensure all require system libraries are installed.

0 commit comments

Comments
 (0)