Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 5936600

Browse files
committed
grpc: grpc.Code is deprecated
To fix: grpc.go:759:39:warning: grpc.Code is deprecated: use status.FromError and Code method instead. (SA1019) (staticcheck) Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent a6e27d6 commit 5936600

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

grpc.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"github.com/sirupsen/logrus"
3131
"golang.org/x/net/context"
3232
"golang.org/x/sys/unix"
33-
"google.golang.org/grpc"
3433
"google.golang.org/grpc/codes"
3534
grpcStatus "google.golang.org/grpc/status"
3635
)
@@ -756,7 +755,7 @@ func (a *agentGRPC) SignalProcess(ctx context.Context, req *pb.SignalProcessRequ
756755

757756
proc, err := ctr.getProcess(req.ExecId)
758757
if err != nil {
759-
return emptyResp, grpcStatus.Errorf(grpc.Code(err), "Could not signal process: %v", err)
758+
return emptyResp, grpcStatus.Errorf(grpcStatus.Convert(err).Code(), "Could not signal process: %v", err)
760759
}
761760

762761
if err := proc.process.Signal(signal); err != nil {

0 commit comments

Comments
 (0)