https://github.com/eatonphil/deferlint
Linter for finding defer statements in Go loops
https://github.com/eatonphil/deferlint
Last synced: 3 months ago
JSON representation
Linter for finding defer statements in Go loops
- Host: GitHub
- URL: https://github.com/eatonphil/deferlint
- Owner: eatonphil
- License: mit
- Created: 2019-07-16T13:07:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-19T08:07:07.000Z (almost 6 years ago)
- Last Synced: 2025-03-18T21:11:18.120Z (4 months ago)
- Language: Go
- Size: 3.91 KB
- Stars: 32
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.MD
Awesome Lists containing this project
README
# deferlint
This package warns when defer is used within loops.
## Example
```bash
$ go get github.com/eatonphil/deferlint
$ go vet -vettool=/Users/philipeaton/go/bin/deferlint ./tests
# github.com/eatonphil/deferlint/tests
tests/deferloop.go:7:3: defer in loop found "defer f()"
```## References
https://github.com/fatih/addlint