From b215fa3ee60acdd430e526abc68a93dd11309967 Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Tue, 15 Feb 2022 18:40:26 +0800 Subject: [PATCH] fix #1541 (#1542) --- ROADMAP.md | 6 +++--- core/errorx/batcherror.go | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 396e512b..1da02bcb 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -20,9 +20,9 @@ We hope that the items listed below will inspire further engagement from the com - [x] Support `goctl bug` to report bugs conveniently ## 2022 -- [ ] Support `goctl mock` command to start a mocking server with given `.api` file -- [ ] Add `httpx.Client` with governance, like circuit breaker etc. -- [ ] Support `goctl doctor` command to report potential issues for given service - [x] Support `context` in redis related methods for timeout and tracing - [x] Support `context` in sql related methods for timeout and tracing - [ ] Support `context` in mongodb related methods for timeout and tracing +- [ ] Add `httpx.Client` with governance, like circuit breaker etc. +- [ ] Support `goctl doctor` command to report potential issues for given service +- [ ] Support `goctl mock` command to start a mocking server with given `.api` file diff --git a/core/errorx/batcherror.go b/core/errorx/batcherror.go index ec8ef0dc..92ae644d 100644 --- a/core/errorx/batcherror.go +++ b/core/errorx/batcherror.go @@ -11,10 +11,12 @@ type ( errorArray []error ) -// Add adds err to be. -func (be *BatchError) Add(err error) { - if err != nil { - be.errs = append(be.errs, err) +// Add adds errs to be, nil errors are ignored. +func (be *BatchError) Add(errs ...error) { + for _, err := range errs { + if err != nil { + be.errs = append(be.errs, err) + } } }