Go to file
Augusto Dwenger J. 724c752aff Add fork information to the README 2021-04-14 20:11:44 +02:00
.drone.yml Replace travis setup with drone CI 2021-04-02 18:47:10 +02:00
.gitignore add the source in 2018-10-19 17:05:41 -07:00
LICENSE Add copyright holder 2021-04-02 18:54:15 +02:00
README.md Add fork information to the README 2021-04-14 20:11:44 +02:00
dll.go Add dependency to correctly read CPU quota inside containers 2021-04-02 19:13:04 +02:00
dll_test.go Rename func splitFilesIntoParts to splitArrayIntoParts with inner vars 2020-10-22 16:55:11 +02:00
go.mod Add dependency to correctly read CPU quota inside containers 2021-04-02 19:13:04 +02:00
go.sum Add dependency to correctly read CPU quota inside containers 2021-04-02 19:13:04 +02:00

README.md

dll

Defer Loop Linter

Build Status

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

This is a fork from gsquire/dll with support for concurrent analyses. The goal of it was to practice the work with goroutines.

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