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 v2
import (
"context"
"errors"
"fmt"
"io"
"os"
@@ -39,7 +40,6 @@ import (
"github.com/containerd/ttrpc"
ptypes "github.com/gogo/protobuf/types"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@@ -85,7 +85,7 @@ func loadShim(ctx context.Context, bundle *Bundle, onClose func()) (_ *shimTask,
}()
f, err := openShimLog(shimCtx, bundle, client.AnonReconnectDialer)
if err != nil {
return nil, errors.Wrap(err, "open shim log pipe when reload")
return nil, fmt.Errorf("open shim log pipe when reload: %w", err)
}
defer func() {
if err != nil {
@@ -394,7 +394,7 @@ func (s *shimTask) Kill(ctx context.Context, signal uint32, all bool) error {
func (s *shimTask) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runtime.ExecProcess, error) {
if err := identifiers.Validate(id); err != nil {
return nil, errors.Wrapf(err, "invalid exec id %s", id)
return nil, fmt.Errorf("invalid exec id %s: %w", id, err)
}
request := &task.ExecProcessRequest{
ID: s.ID(),