From 9d35ebba062cae9cc7bd716ad279ac7d44060a93 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Wed, 19 Apr 2023 18:48:00 -0400 Subject: std: fix various nilness findings Found by running $ go run golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness@latest std No actual bugs--other than one panic(nil)--but a few places where error nilness was unclear. Change-Id: Ia916ba30f46f29c1bcf928cc62280169b922463a Reviewed-on: https://go-review.googlesource.com/c/go/+/486675 Reviewed-by: Ian Lance Taylor Run-TryBot: Alan Donovan TryBot-Result: Gopher Robot Auto-Submit: Alan Donovan --- src/testing/example.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/testing') diff --git a/src/testing/example.go b/src/testing/example.go index f618b06de1..42ee555cb2 100644 --- a/src/testing/example.go +++ b/src/testing/example.go @@ -93,8 +93,7 @@ func (eg *InternalExample) processRunResult(stdout string, timeSpent time.Durati if recovered != nil { // Propagate the previously recovered result, by panicking. panic(recovered) - } - if !finished && recovered == nil { + } else if !finished { panic(errNilPanicOrGoexit) } -- cgit v1.3-6-g1900