Skip to content

Commit dacab89

Browse files
authored
Merge pull request #273 from kisielk/readme-update-2
README: Clarify the purpose and limitations of the program.
2 parents e3eb51b + 164ec2e commit dacab89

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
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

0 commit comments

Comments
 (0)