Skip to content

Commit 1cbf3af

Browse files
committed
docs: add section about typecheck
1 parent a303529 commit 1cbf3af

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/src/docs/usage/faq.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,22 @@ The same as the Go team (the 2 last minor versions)
3232

3333
Because the first run caches type information. All subsequent runs will be fast.
3434
Usually this options is used during development on local machine and compilation was already performed.
35+
36+
## Why do you have `typecheck` errors?
37+
38+
`typecheck` is like the front-end of a Go compiler, parses and type-checks Go code, it manages compilation errors.
39+
40+
It cannot be disabled because of that.
41+
42+
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.
43+
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.
45+
46+
A linter that reports `typecheck` errors is not able to report other issues for a package because that kind of error doesn't allow it to perform its own analysis.
47+
48+
How to troubleshoot:
49+
50+
- [ ] Ensure the version of `golangci-lint` is built with a compatible version of Go.
51+
- [ ] Ensure dependencies are up-to-date with `go mod tidy`.
52+
- [ ] Ensure building works with `go run ./...`/`go build ./...` - whole package.
53+
- [ ] If using CGO, ensure all C dependencies are installed.

0 commit comments

Comments
 (0)