aboutsummaryrefslogtreecommitdiffstats
path: root/go.mod
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-01-05 12:16:34 +0100
committerRobin Jarry <robin@jarry.cc>2023-01-06 23:51:52 +0100
commit175c1c822084d0f42892729c8e095397bd830966 (patch)
tree332ef46037e29509eb5ee9466ec2e0e2e12e2ee3 /go.mod
parent10b995f0196c8243132c3f435d4e11b3c9700e35 (diff)
downloadaerc-175c1c822084d0f42892729c8e095397bd830966.tar.gz
contrib: add linter to check for panic handler in goroutines
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>
Diffstat (limited to 'go.mod')
-rw-r--r--go.mod1
1 files changed, 1 insertions, 0 deletions
diff --git a/go.mod b/go.mod
index 10421e9a..cc6dcbac 100644
--- a/go.mod
+++ b/go.mod
@@ -39,6 +39,7 @@ require (
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778
github.com/zenhack/go.notmuch v0.0.0-20211022191430-4d57e8ad2a8b
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
+ golang.org/x/tools v0.1.12
)
replace golang.org/x/crypto => github.com/ProtonMail/crypto v0.0.0-20200420072808-71bec3603bf3