From e8dbe827cb344497817311b5a0379783fb54ac59 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 5 Jan 2023 14:45:40 +0800 Subject: [PATCH] fix: use %w --- services/actions/notifier_helper.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/actions/notifier_helper.go b/services/actions/notifier_helper.go index 95ace63c10..23d8368c6b 100644 --- a/services/actions/notifier_helper.go +++ b/services/actions/notifier_helper.go @@ -119,12 +119,12 @@ func notify(ctx context.Context, input *notifyInput) error { // Get the commit object for the ref commit, err := gitRepo.GetCommit(input.Ref) if err != nil { - return fmt.Errorf("gitRepo.GetCommit: %v", err) + return fmt.Errorf("gitRepo.GetCommit: %w", err) } workflows, err := actions_module.DetectWorkflows(commit, input.Event) if err != nil { - return fmt.Errorf("DetectWorkflows: %v", err) + return fmt.Errorf("DetectWorkflows: %w", err) } if len(workflows) == 0 { @@ -134,7 +134,7 @@ func notify(ctx context.Context, input *notifyInput) error { p, err := json.Marshal(input.Payload) if err != nil { - return fmt.Errorf("json.Marshal: %v", err) + return fmt.Errorf("json.Marshal: %w", err) } for id, content := range workflows {