Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | contrib: add linter to check for panic handler in goroutines | Robin Jarry | 2023-01-06 | 1 | -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> |