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/machine/fedora.go | |
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/machine/fedora.go')
-rw-r--r-- | pkg/machine/fedora.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/machine/fedora.go b/pkg/machine/fedora.go index 14a173da6..46e450418 100644 --- a/pkg/machine/fedora.go +++ b/pkg/machine/fedora.go @@ -4,6 +4,7 @@ package machine import ( + "errors" "fmt" "io" "io/ioutil" @@ -13,7 +14,6 @@ import ( "path/filepath" "regexp" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -107,12 +107,12 @@ func getFedoraDownload(releaseStream string) (string, *url.URL, int64, error) { newLocation := rawURL + file downloadURL, err := url.Parse(newLocation) if err != nil { - return "", nil, -1, errors.Wrapf(err, "invalid URL generated from discovered Fedora file: %s", newLocation) + return "", nil, -1, fmt.Errorf("invalid URL generated from discovered Fedora file: %s: %w", newLocation, err) } resp, err := http.Head(newLocation) if err != nil { - return "", nil, -1, errors.Wrapf(err, "head request failed: %s", newLocation) + return "", nil, -1, fmt.Errorf("head request failed: %s: %w", newLocation, err) } _ = resp.Body.Close() |