From 23ba54784a49fe13c665396c49a5ab3baa70ebd5 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Thu, 26 Oct 2023 00:03:43 +0200 Subject: linters: avoid crash when analyzing function call When encountering a statement such as: go functionName() The identifier is not a local symbol but should be looked up in the current package. Do not consider that all these statements will refer to local variables. The only way to do this is to run a second analyzer that depends on the first one. Store all unresolved methods and functions into a indirectCalls struct. Reuse that result in the second analyzer to resolve the function declarations and check their bodies for the defer log.PanicHandler() statement. Fix one newly reported issues. Signed-off-by: Robin Jarry Reviewed-by: Tim Culverhouse --- worker/jmap/push.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'worker/jmap') diff --git a/worker/jmap/push.go b/worker/jmap/push.go index 34a90ca4..2f7b05e6 100644 --- a/worker/jmap/push.go +++ b/worker/jmap/push.go @@ -16,6 +16,8 @@ import ( ) func (w *JMAPWorker) monitorChanges() { + defer log.PanicHandler() + events := push.EventSource{ Client: w.client, Handler: w.handleChange, -- cgit