From 719eea2fe74cb5d7485be9f8d4b4709b745c4d2f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 26 Apr 2024 12:53:20 +0200 Subject: dashboard/app: prevent staticcheck false positive Otherwise it complains: dashboard/app/tree_test.go:1136:5: SA5011(related information): this check suggests that the pointer can be nil if found == nil { ^ --- dashboard/app/tree_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/dashboard/app/tree_test.go b/dashboard/app/tree_test.go index f12799b42..e2e5b8fd0 100644 --- a/dashboard/app/tree_test.go +++ b/dashboard/app/tree_test.go @@ -1135,6 +1135,7 @@ func (ctx *treeTestCtx) doJob(resp *dashapi.JobPollResp, day int) { } if found == nil { ctx.ctx.t.Fatalf("unknown job request: %#v", resp) + return // to avoid staticcheck false positive about nil deref } // Figure out what should the result be. result := treeTestOK -- cgit mrf-deployment