From 72acf8cf7b655ad1500f452a26aa842e5487f20e Mon Sep 17 00:00:00 2001 From: Kent Ross Date: Mon, 23 Sep 2024 15:03:02 -0700 Subject: [PATCH] drop support for 1.20 --- safety_test.go | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/safety_test.go b/safety_test.go index 8bfc36c..1a61233 100644 --- a/safety_test.go +++ b/safety_test.go @@ -5,7 +5,6 @@ package parallel import ( "context" "errors" - "reflect" "runtime" "sync" "sync/atomic" @@ -436,30 +435,3 @@ func TestForgottenPipeLegiblePanic(t *testing.T) { assertPanicsWithValue(t, "parallel executor pipe error: a "+ "collector using this same executor was probably not awaited", exec.Wait) } - -func TestPanicNil(t *testing.T) { - // Read what is actually thrown when we call panic(nil) - nilPanic := func() (p any) { - defer func() { - p = recover() - }() - panic(nil) - }() - if nilPanic != nil { - // We are probably on go1.21 or later, where panic(nil) is transformed - // into a runtime.PanicNilError. - assert.Equal(t, - "PanicNilError", - reflect.TypeOf(nilPanic).Elem().Name()) - return - } - - t.Parallel() - g := Unlimited(context.Background()) - g.Go(func(context.Context) { - // Panics that are literally `nil` should also be caught, even though - // they aren't detectable without some trickery (prior to go1.21) - panic(nil) - }) - assertPanicsWithValue(t, nil, g.Wait) -}