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:
@@ -18,6 +18,7 @@ package diff
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
diffapi "github.com/containerd/containerd/api/services/diff/v1"
|
||||
"github.com/containerd/containerd/api/types"
|
||||
@@ -27,7 +28,6 @@ import (
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/services"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -65,16 +65,16 @@ func init() {
|
||||
for i, n := range orderedNames {
|
||||
differp, ok := differs[n]
|
||||
if !ok {
|
||||
return nil, errors.Errorf("needed differ not loaded: %s", n)
|
||||
return nil, fmt.Errorf("needed differ not loaded: %s", n)
|
||||
}
|
||||
d, err := differp.Instance()
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "could not load required differ due plugin init error: %s", n)
|
||||
return nil, fmt.Errorf("could not load required differ due plugin init error: %s: %w", n, err)
|
||||
}
|
||||
|
||||
ordered[i], ok = d.(differ)
|
||||
if !ok {
|
||||
return nil, errors.Errorf("differ does not implement Comparer and Applier interface: %s", n)
|
||||
return nil, fmt.Errorf("differ does not implement Comparer and Applier interface: %s", n)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -18,11 +18,11 @@ package diff
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
diffapi "github.com/containerd/containerd/api/services/diff/v1"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/services"
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user