From 50139d38195922662572ef417ce05aae2dd5eb2d Mon Sep 17 00:00:00 2001 From: b4b4r07 Date: Sat, 12 Mar 2022 22:29:19 +0900 Subject: [PATCH] Expand errors.New --- pkg/errors/wrap.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/errors/wrap.go b/pkg/errors/wrap.go index dcaf158..af3bed0 100644 --- a/pkg/errors/wrap.go +++ b/pkg/errors/wrap.go @@ -4,9 +4,11 @@ import ( "github.com/pkg/errors" ) -func New(message string) error { +func New(messages ...string) error { var e Errors - e.Append(errors.New(message)) + for _, message := range messages { + e.Append(errors.New(message)) + } return e.ErrorOrNil() }