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

@@ -25,7 +25,6 @@ import (
"github.com/containerd/containerd/gc"
"github.com/containerd/containerd/log"
"github.com/pkg/errors"
bolt "go.etcd.io/bbolt"
)
@@ -290,7 +289,7 @@ func references(ctx context.Context, tx *bolt.Tx, node gc.Node, fn func(gc.Node)
case ResourceSnapshot, resourceSnapshotFlat:
parts := strings.SplitN(node.Key, "/", 2)
if len(parts) != 2 {
return errors.Errorf("invalid snapshot gc key %s", node.Key)
return fmt.Errorf("invalid snapshot gc key %s", node.Key)
}
ss := parts[0]
name := parts[1]
@@ -435,7 +434,7 @@ func remove(ctx context.Context, tx *bolt.Tx, node gc.Node) error {
if sbkt != nil {
parts := strings.SplitN(node.Key, "/", 2)
if len(parts) != 2 {
return errors.Errorf("invalid snapshot gc key %s", node.Key)
return fmt.Errorf("invalid snapshot gc key %s", node.Key)
}
ssbkt := sbkt.Bucket([]byte(parts[0]))
if ssbkt != nil {