Go to file
Augusto Dwenger J. 9074ec136e Add Golang module file
With Golang 1.16 is the module-aware mode enabled by default and to work
out of the box it is nessesary to have a module file inside the project.

Refs:
- https://golang.org/doc/go1.16#go-command
2021-04-19 15:54:56 +02:00
.gitignore add the source in 2018-10-19 17:05:41 -07:00
.travis.yml update Go versions for Travis (#5) 2020-05-15 12:24:17 -07:00
LICENSE Initial commit 2018-10-19 16:38:21 -07:00
README.md add the build badge 2018-10-19 17:18:01 -07:00
dll.go update visitor approach 2018-10-29 20:56:16 -07:00
dll_test.go update visitor approach 2018-10-29 20:56:16 -07:00
go.mod Add Golang module file 2021-04-19 15:54:56 +02:00

README.md

dll

Defer Loop Linter

Build Status

A simple linter to find defer statements inside of for loops in Go source.

Why?

It's often erroneous to use defer inside of a loop as it can lead to memory leaks or other unintended behavior. It can also be easy to miss this in a code review as using defer to close sockets or files is a common Go idiom. This tool aims to point these out by simply printing the line of a defer statement when it is found inside of a loop.

Install

go get github.com/gsquire/dll

Usage

dll source.go

dll *.go

Contributing

Found a bug? Found a case this didn't catch? Great! Feel free to open an issue or add a test case!

License

MIT