Skip to content

Commit 2873776

Browse files
committed
rm not used func args (linter)
1 parent 41cda29 commit 2873776

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

err2_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ func TestPanickingCatchAll(t *testing.T) {
292292
func() {
293293
defer err2.Catch(
294294
err2.Noop,
295-
func(v any) {},
295+
func(any) {},
296296
)
297297
panic("panic")
298298
},
@@ -304,7 +304,7 @@ func TestPanickingCatchAll(t *testing.T) {
304304
func() {
305305
defer err2.Catch(
306306
err2.Err(func(error) {}), // Using simplifier
307-
func(v any) {},
307+
func(any) {},
308308
)
309309
var b []byte
310310
b[0] = 0
@@ -453,7 +453,7 @@ func TestPanicking_Handle(t *testing.T) {
453453
func() (err error) {
454454
defer err2.Handle(&err,
455455
func(err error) error { return err },
456-
func(p any) {},
456+
func(any) {},
457457
)
458458
panic("panic")
459459
},
@@ -463,7 +463,7 @@ func TestPanicking_Handle(t *testing.T) {
463463
{"general panic stoped with handler",
464464
args{
465465
func() (err error) {
466-
defer err2.Handle(&err, func(p any) {})
466+
defer err2.Handle(&err, func(any) {})
467467
panic("panic")
468468
},
469469
},
@@ -472,7 +472,7 @@ func TestPanicking_Handle(t *testing.T) {
472472
{"general panic stoped with handler plus fmt string",
473473
args{
474474
func() (err error) {
475-
defer err2.Handle(&err, func(p any) {}, "string")
475+
defer err2.Handle(&err, func(any) {}, "string")
476476
panic("panic")
477477
},
478478
},
@@ -492,7 +492,7 @@ func TestPanicking_Handle(t *testing.T) {
492492
{"runtime.error panic stopped with handler",
493493
args{
494494
func() (err error) {
495-
defer err2.Handle(&err, func(p any) {})
495+
defer err2.Handle(&err, func(any) {})
496496
var b []byte
497497
b[0] = 0
498498
return nil
@@ -600,12 +600,12 @@ func TestCatch_Panic(t *testing.T) {
600600
}()
601601

602602
defer err2.Catch(
603-
func(err error) error {
603+
func(error) error {
604604
t.Log("it was panic, not an error")
605605
t.Fail() // we should not be here
606606
return nil
607607
},
608-
func(v any) {
608+
func(any) {
609609
panicHandled = true
610610
})
611611

try/out_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func ExampleOut1_copyFile() {
2626

2727
// If you prefer immediate error handling for some reason.
2828
_ = try.Out1(io.Copy(w, r)).
29-
Handle(io.EOF, func(err error) error {
29+
Handle(io.EOF, func(error) error {
3030
fmt.Println("err == io.EOF")
3131
return nil // by returning nil we can reset the error
3232
// return err // fallthru to next check if err != nil
@@ -136,7 +136,7 @@ func ExampleResult1_Handle() {
136136
callRead := func(in io.Reader, b []byte) (eof bool, n int) {
137137
// we should use try.To1, but this is sample of try.Out.Handle
138138
n = try.Out1(in.Read(b)).
139-
Handle(io.EOF, func(err error) error {
139+
Handle(io.EOF, func(error) error {
140140
eof = true
141141
return nil
142142
}). // our errors.Is == true, handler to get eof status

0 commit comments

Comments
 (0)