diff options
author | Sascha Grunert <sgrunert@redhat.com> | 2022-07-06 09:48:36 +0200 |
---|---|---|
committer | Sascha Grunert <sgrunert@redhat.com> | 2022-07-08 08:54:47 +0200 |
commit | a46f798831df06c472b288db7b34de8536a7ea5a (patch) | |
tree | c370fb0fc23b461691906e308b179a50e583228b /pkg/bindings/manifests | |
parent | 862cc42ddc11ff56b41be128182b748b0843dff3 (diff) | |
download | podman-a46f798831df06c472b288db7b34de8536a7ea5a.tar.gz podman-a46f798831df06c472b288db7b34de8536a7ea5a.tar.bz2 podman-a46f798831df06c472b288db7b34de8536a7ea5a.zip |
pkg: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.
[NO NEW TESTS NEEDED]
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Diffstat (limited to 'pkg/bindings/manifests')
-rw-r--r-- | pkg/bindings/manifests/manifests.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/bindings/manifests/manifests.go b/pkg/bindings/manifests/manifests.go index a68dd5a4e..80153c4b4 100644 --- a/pkg/bindings/manifests/manifests.go +++ b/pkg/bindings/manifests/manifests.go @@ -2,6 +2,8 @@ package manifests import ( "context" + "errors" + "fmt" "io/ioutil" "net/http" "strconv" @@ -15,7 +17,6 @@ import ( "github.com/containers/podman/v4/pkg/domain/entities" "github.com/containers/podman/v4/pkg/errorhandling" jsoniter "github.com/json-iterator/go" - "github.com/pkg/errors" ) // Create creates a manifest for the given name. Optional images to be associated with @@ -219,13 +220,13 @@ func Modify(ctx context.Context, name string, images []string, options *ModifyOp data, err := ioutil.ReadAll(response.Body) if err != nil { - return "", errors.Wrap(err, "unable to process API response") + return "", fmt.Errorf("unable to process API response: %w", err) } if response.IsSuccess() || response.IsRedirection() { var report entities.ManifestModifyReport if err = jsoniter.Unmarshal(data, &report); err != nil { - return "", errors.Wrap(err, "unable to decode API response") + return "", fmt.Errorf("unable to decode API response: %w", err) } err = errorhandling.JoinErrors(report.Errors) @@ -244,7 +245,7 @@ func Modify(ctx context.Context, name string, images []string, options *ModifyOp ResponseCode: response.StatusCode, } if err = jsoniter.Unmarshal(data, &errModel); err != nil { - return "", errors.Wrap(err, "unable to decode API response") + return "", fmt.Errorf("unable to decode API response: %w", err) } return "", &errModel } |