diff --git a/err2_test.go b/err2_test.go index 2d2c36b..aa1f7e6 100644 --- a/err2_test.go +++ b/err2_test.go @@ -292,7 +292,7 @@ func TestPanickingCatchAll(t *testing.T) { func() { defer err2.Catch( err2.Noop, - func(v any) {}, + func(any) {}, ) panic("panic") }, @@ -304,7 +304,7 @@ func TestPanickingCatchAll(t *testing.T) { func() { defer err2.Catch( err2.Err(func(error) {}), // Using simplifier - func(v any) {}, + func(any) {}, ) var b []byte b[0] = 0 @@ -453,7 +453,7 @@ func TestPanicking_Handle(t *testing.T) { func() (err error) { defer err2.Handle(&err, func(err error) error { return err }, - func(p any) {}, + func(any) {}, ) panic("panic") }, @@ -463,7 +463,7 @@ func TestPanicking_Handle(t *testing.T) { {"general panic stoped with handler", args{ func() (err error) { - defer err2.Handle(&err, func(p any) {}) + defer err2.Handle(&err, func(any) {}) panic("panic") }, }, @@ -472,7 +472,7 @@ func TestPanicking_Handle(t *testing.T) { {"general panic stoped with handler plus fmt string", args{ func() (err error) { - defer err2.Handle(&err, func(p any) {}, "string") + defer err2.Handle(&err, func(any) {}, "string") panic("panic") }, }, @@ -492,7 +492,7 @@ func TestPanicking_Handle(t *testing.T) { {"runtime.error panic stopped with handler", args{ func() (err error) { - defer err2.Handle(&err, func(p any) {}) + defer err2.Handle(&err, func(any) {}) var b []byte b[0] = 0 return nil @@ -600,12 +600,12 @@ func TestCatch_Panic(t *testing.T) { }() defer err2.Catch( - func(err error) error { + func(error) error { t.Log("it was panic, not an error") t.Fail() // we should not be here return nil }, - func(v any) { + func(any) { panicHandled = true }) diff --git a/try/out_test.go b/try/out_test.go index d032771..f588267 100644 --- a/try/out_test.go +++ b/try/out_test.go @@ -26,7 +26,7 @@ func ExampleOut1_copyFile() { // If you prefer immediate error handling for some reason. _ = try.Out1(io.Copy(w, r)). - Handle(io.EOF, func(err error) error { + Handle(io.EOF, func(error) error { fmt.Println("err == io.EOF") return nil // by returning nil we can reset the error // return err // fallthru to next check if err != nil @@ -136,7 +136,7 @@ func ExampleResult1_Handle() { callRead := func(in io.Reader, b []byte) (eof bool, n int) { // we should use try.To1, but this is sample of try.Out.Handle n = try.Out1(in.Read(b)). - Handle(io.EOF, func(err error) error { + Handle(io.EOF, func(error) error { eof = true return nil }). // our errors.Is == true, handler to get eof status