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

Commit

Permalink
grpc: grpc.Code is deprecated
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bergwolf committed Sep 7, 2018
1 parent a6e27d6 commit 5936600
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"golang.org/x/sys/unix"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
grpcStatus "google.golang.org/grpc/status"
)
Expand Down Expand Up @@ -756,7 +755,7 @@ func (a *agentGRPC) SignalProcess(ctx context.Context, req *pb.SignalProcessRequ

proc, err := ctr.getProcess(req.ExecId)
if err != nil {
return emptyResp, grpcStatus.Errorf(grpc.Code(err), "Could not signal process: %v", err)
return emptyResp, grpcStatus.Errorf(grpcStatus.Convert(err).Code(), "Could not signal process: %v", err)
}

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

0 comments on commit 5936600

Please sign in to comment.