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

@@ -18,6 +18,7 @@ package metadata
import (
"context"
"fmt"
"os"
"path/filepath"
"reflect"
@@ -34,7 +35,6 @@ import (
"github.com/containerd/containerd/snapshots"
"github.com/containerd/containerd/snapshots/native"
"github.com/containerd/containerd/snapshots/testsuite"
"github.com/pkg/errors"
bolt "go.etcd.io/bbolt"
)
@@ -319,7 +319,7 @@ func (s *tmpSnapshotter) create(ctx context.Context, key, parent string, kind sn
if target != "" {
for _, name := range s.targets[target] {
if s.snapshots[name].Parent == parent {
return nil, errors.Wrap(errdefs.ErrAlreadyExists, "found target")
return nil, fmt.Errorf("found target: %w", errdefs.ErrAlreadyExists)
}
}
}
@@ -355,7 +355,7 @@ func (s *tmpSnapshotter) Commit(ctx context.Context, name, key string, opts ...s
base.Kind = snapshots.KindCommitted
if _, ok := s.snapshots[name]; ok {
return errors.Wrap(errdefs.ErrAlreadyExists, "found name")
return fmt.Errorf("found name: %w", errdefs.ErrAlreadyExists)
}
src, ok := s.snapshots[key]