Chore: Replace go-multierror with errors package (#66432)

* code refactor and type assertions added to tests

* no-lint rule added for specific line
This commit is contained in:
SatVeer Singh
2023-06-19 14:59:45 +05:30
committed by GitHub
parent a75752b085
commit 1bfa3a0f1e
8 changed files with 25 additions and 30 deletions

View File

@@ -2,9 +2,8 @@ package util
import (
"context"
"errors"
"sync"
"github.com/hashicorp/go-multierror"
)
// this is a decorator for a regular context that contains a custom error and returns the
@@ -18,7 +17,7 @@ func (c *contextWithCancellableReason) Err() error {
c.mtx.Lock()
defer c.mtx.Unlock()
if c.err != nil {
return multierror.Append(c.Context.Err(), c.err)
return errors.Join(c.Context.Err(), c.err)
}
return c.Context.Err()
}