From a8e99a685dda088a784d4a3d6fa0b401e3f6097d Mon Sep 17 00:00:00 2001 From: qydysky Date: Sun, 21 Jan 2024 16:01:29 +0800 Subject: [PATCH] 1 --- component/Component_test.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/component/Component_test.go b/component/Component_test.go index 9ca581f..39b9c4b 100644 --- a/component/Component_test.go +++ b/component/Component_test.go @@ -141,24 +141,24 @@ import ( // } func TestMain(t *testing.T) { - c1 := NewComp(func(ctx context.Context, ptr string) error { + c1 := NewComp(func(ctx context.Context, ptr string) (any, error) { fmt.Println(ptr) - return nil + return nil, nil }) c1.Run(context.Background(), "1") } -func TestMain2(t *testing.T) { - c1 := NewComp(func(ctx context.Context, ptr string) error { - fmt.Println(ptr) - return ErrSelfDel - }) - c2 := NewComp(func(ctx context.Context, ptr string) error { - fmt.Println(ptr + "s") - return nil - }) - cs1 := NewComps[string]() - cs1.Put(c1, c2) - cs1.Run(context.Background(), "1") - cs1.Start(context.Background(), "1") -} +// func TestMain2(t *testing.T) { +// c1 := NewComp(func(ctx context.Context, ptr string) (any,error) { +// fmt.Println(ptr) +// return ErrSelfDel +// }) +// c2 := NewComp(func(ctx context.Context, ptr string) (any,error) { +// fmt.Println(ptr + "s") +// return nil +// }) +// cs1 := NewComps[string]() +// cs1.Put(c1, c2) +// cs1.Run(context.Background(), "1") +// cs1.Start(context.Background(), "1") +// } -- 2.39.2