Skip to content

Commit b34b2a2

Browse files
committed
docs: grpc.Errorf is deprecated, use status.Errorf
1 parent def7795 commit b34b2a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README_zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ make: *** [test] Error 2
242242
package server
243243

244244
import (
245-
"google.golang.org/grpc"
246245
"google.golang.org/grpc/codes"
246+
"google.golang.org/grpc/status"
247247

248248
"github.com/golang/protobuf/ptypes/empty"
249249
"github.com/lileio/slack"
@@ -256,7 +256,7 @@ var api = sl.New(os.Getenv("SLACK_TOKEN"))
256256
func (s SlackServer) Announce(ctx context.Context, r *slack.AnnounceRequest) (*empty.Empty, error) {
257257
_, _, err := api.PostMessage(r.Channel, r.Msg, sl.PostMessageParameters{})
258258
if err != nil {
259-
return nil, grpc.Errorf(codes.Internal, err.Error())
259+
return nil, status.Errorf(codes.Internal, err.Error())
260260
}
261261

262262
return &empty.Empty{}, nil

0 commit comments

Comments
 (0)