aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/linters.go
Commit message (Collapse)AuthorAgeFilesLines
* contrib: add linter to check for panic handler in goroutinesRobin Jarry2023-01-061-0/+128
If log.PanicHandler() is not installed in a goroutine and a panic occurs, the terminal state is not restored. This causes the panic trace to be unreadable since the terminal is broken. Add a custom analyzer that parses our code and ensures that: defer log.PanicHandler() is the first statement of all functions that are executed in goroutines. Include that linter in golangci config. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>