// }
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")
+// }