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:
@@ -17,13 +17,14 @@
|
||||
package ttrpcutil
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
v1 "github.com/containerd/containerd/api/services/ttrpc/events/v1"
|
||||
"github.com/containerd/containerd/pkg/dialer"
|
||||
"github.com/containerd/ttrpc"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const ttrpcDialTimeout = 5 * time.Second
|
||||
@@ -43,7 +44,7 @@ func NewClient(address string, opts ...ttrpc.ClientOpts) (*Client, error) {
|
||||
connector := func() (*ttrpc.Client, error) {
|
||||
conn, err := dialer.Dialer(address, ttrpcDialTimeout)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to connect")
|
||||
return nil, fmt.Errorf("failed to connect: %w", err)
|
||||
}
|
||||
|
||||
client := ttrpc.NewClient(conn, opts...)
|
||||
|
||||
Reference in New Issue
Block a user