From 2f515adf7c8311680a5bd993d6674ba5c3cc1894 Mon Sep 17 00:00:00 2001 From: qydysky Date: Tue, 15 Aug 2023 19:36:49 +0800 Subject: [PATCH] add --- component/testdata/comp_test.go | 2 +- component/testdata/eg/eg.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/component/testdata/comp_test.go b/component/testdata/comp_test.go index 55eba5f..3dd5aae 100644 --- a/component/testdata/comp_test.go +++ b/component/testdata/comp_test.go @@ -9,7 +9,7 @@ import ( func TestMain(t *testing.T) { var s = "s" - if e := comp.Run[string](`test`, context.Background(), &s); e != nil { + if e := comp.Run[string](`test`, context.Background(), &s); e.Error() != "1" { t.Fatal(e) } } diff --git a/component/testdata/eg/eg.go b/component/testdata/eg/eg.go index d5764df..6aa1637 100644 --- a/component/testdata/eg/eg.go +++ b/component/testdata/eg/eg.go @@ -2,6 +2,7 @@ package eg import ( "context" + "errors" comp "github.com/qydysky/part/component" ) @@ -15,6 +16,8 @@ func init() { } func deal(ctx context.Context, ptr *string) error { - println(*ptr) + if *ptr == "s" { + return errors.New("1") + } return nil } -- 2.39.2