feat: replace github.com/pkg/errors to errors

Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
This commit is contained in:
haoyun
2022-01-07 10:19:31 +08:00
parent 3ccd43c8f6
commit bbe46b8c43
299 changed files with 1896 additions and 1874 deletions

View File

@@ -27,7 +27,6 @@ import (
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/platforms"
"github.com/opencontainers/image-spec/identity"
"github.com/pkg/errors"
"github.com/urfave/cli"
)
@@ -93,7 +92,7 @@ When you are done, use the unmount command.
ps := context.String("platform")
p, err := platforms.Parse(ps)
if err != nil {
return errors.Wrapf(err, "unable to parse platform %s", ps)
return fmt.Errorf("unable to parse platform %s: %w", ps, err)
}
img, err := client.ImageService().Get(ctx, ref)
@@ -103,7 +102,7 @@ When you are done, use the unmount command.
i := containerd.NewImageWithPlatform(client, img, platforms.Only(p))
if err := i.Unpack(ctx, snapshotter); err != nil {
return errors.Wrap(err, "error unpacking image")
return fmt.Errorf("error unpacking image: %w", err)
}
diffIDs, err := i.RootFS(ctx)