File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 11# errcheck
22
3- errcheck is a program for checking for unchecked errors in Go code.
3+ errcheck finds silently ignored errors in Go code.
4+
5+ For all callables that are not in the excluded list, all returned errors must
6+ be either assigned to a variable or explicitly discarded by being assigned to ` _ ` .
7+
8+ Please note that errcheck does not do any further analysis on assigned errors.
9+
10+ For example, it will not complain about this:
11+
12+ ``` go
13+ err = foo ()
14+
15+ // First error is discarded
16+ err = bar ()
17+ if err != nil {
18+ ...
19+ }
20+ ```
21+
22+ For such analysis and more, please see [ staticcheck] ( https://staticcheck.dev/ ) .
423
524![ errcheck] ( https://github.com/kisielk/errcheck/workflows/errcheck/badge.svg )
625
You can’t perform that action at this time.
0 commit comments