Remove use of github.com/pkg/errors (#4696)

This package is deprecated, archived, and in maintenance mode, since Go
errors support wrapping natively.

For #2152.

Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
Jason Hall
2022-05-18 05:29:35 -04:00
committed by GitHub
parent 4ea50cb1c0
commit 4dd7fb1c0d
30 changed files with 185 additions and 205 deletions
+2 -5
View File
@@ -18,13 +18,10 @@ import (
"sync"
"time"
"github.com/open-policy-agent/opa/plugins"
"github.com/pkg/errors"
"github.com/open-policy-agent/opa/bundle"
"github.com/open-policy-agent/opa/logging"
"github.com/open-policy-agent/opa/metrics"
"github.com/open-policy-agent/opa/plugins"
"github.com/open-policy-agent/opa/plugins/rest"
"github.com/open-policy-agent/opa/util"
)
@@ -285,7 +282,7 @@ func (d *Downloader) download(ctx context.Context, m metrics.Metrics) (*download
resp, err := d.client.Do(ctx, "GET", d.path)
m.Timer(metrics.BundleRequest).Stop()
if err != nil {
return nil, errors.Wrap(err, "request failed")
return nil, fmt.Errorf("request failed: %w", err)
}
defer util.Close(resp)