diff options
author | Sascha Grunert <sgrunert@redhat.com> | 2022-06-30 10:05:44 +0200 |
---|---|---|
committer | Sascha Grunert <sgrunert@redhat.com> | 2022-06-30 12:58:57 +0200 |
commit | e8adec5f41388916b0f2206dc898a5587d51467c (patch) | |
tree | 856d4c6e84366560554bb91c5a0c33e0c0e29509 /cmd/podman/images/load.go | |
parent | 3426d56b92be2ac1c3cc62fc578e9cb6d64aca81 (diff) | |
download | podman-e8adec5f41388916b0f2206dc898a5587d51467c.tar.gz podman-e8adec5f41388916b0f2206dc898a5587d51467c.tar.bz2 podman-e8adec5f41388916b0f2206dc898a5587d51467c.zip |
cmd/podman: 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.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Diffstat (limited to 'cmd/podman/images/load.go')
-rw-r--r-- | cmd/podman/images/load.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go index c18c32387..367b628c7 100644 --- a/cmd/podman/images/load.go +++ b/cmd/podman/images/load.go @@ -2,6 +2,7 @@ package images import ( "context" + "errors" "fmt" "io" "io/ioutil" @@ -14,7 +15,6 @@ import ( "github.com/containers/podman/v4/cmd/podman/validate" "github.com/containers/podman/v4/pkg/domain/entities" "github.com/containers/podman/v4/pkg/util" - "github.com/pkg/errors" "github.com/spf13/cobra" "golang.org/x/term" ) @@ -91,18 +91,18 @@ func load(cmd *cobra.Command, args []string) error { } } else { if term.IsTerminal(int(os.Stdin.Fd())) { - return errors.Errorf("cannot read from terminal, use command-line redirection or the --input flag") + return errors.New("cannot read from terminal, use command-line redirection or the --input flag") } outFile, err := ioutil.TempFile(util.Tmpdir(), "podman") if err != nil { - return errors.Errorf("creating file %v", err) + return fmt.Errorf("creating file %v", err) } defer os.Remove(outFile.Name()) defer outFile.Close() _, err = io.Copy(outFile, os.Stdin) if err != nil { - return errors.Errorf("copying file %v", err) + return fmt.Errorf("copying file %v", err) } loadOpts.Input = outFile.Name() } |