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.
44
55![ errcheck] ( https://github.com/kisielk/errcheck/workflows/errcheck/badge.svg )
66
7+ For all callables that are not in the excluded list, all returned errors must
8+ be either assigned to a variable or explicitly discarded by being assigned to ` _ ` .
9+
10+ Please note that errcheck does not do any further analysis on assigned errors.
11+
12+ For example, it will not complain about this:
13+
14+ ``` go
15+ err := foo ()
16+
17+ // First error is discarded
18+ err = bar ()
19+ if err != nil {
20+ ...
21+ }
22+ ```
23+
24+ For such analysis and more, please see [ staticcheck] ( https://staticcheck.dev/ ) .
25+
726## Install
827
928 go install github.com/kisielk/errcheck@latest
You can’t perform that action at this time.
0 commit comments