Package tickeryzer defines an Analyzer that checks missing (*time.Ticker).Stop() call, which can cause resources leak.
go get github.com/orijtech/tickeryzer/cmd/tickeryzer
cd $GOPATH/src/github.com/orijtech/tickeryzer
git checkout v0.0.1
go get
install ./cmd/tickeryzer
docker pull ghcr.io/orijtech/tickeryzer:latest
You can run tickeryzer
either on a Go package or Go files, the same way as
other Go tools work.
Example:
tickeryzer github.com/orijtech/tickeryzer/testdata/src/a
or:
tickeryzer ./testdata/src/a/a.go
With Docker:
docker run --volume $(pwd):/app --workdir /app ghcr.io/orijtech/tickeryzer:latest ./testdata/src/a/a.go
Sample output:
/go/src/github.com/orijtech/tickeryzer/testdata/a/a.go:9:2: missing ticker.Stop() call
Go 1.15+
Add test case to testdata/src/a
directory, then run:
go test
All contributions are welcome, please report bug or open a pull request.