Skip to content

Commit

Permalink
drop support for 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
mumbleskates committed Sep 23, 2024
1 parent 6ecaa84 commit 72acf8c
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions safety_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package parallel
import (
"context"
"errors"
"reflect"
"runtime"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -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)
}

0 comments on commit 72acf8c

Please sign in to comment.