Codebase list golang-github-go-kit-kit / 40e43af
examples/addsvc: fix gRPC crashing bug Peter Bourgon 7 years ago
1 changed file(s) with 8 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
4242
4343 func (s *grpcServer) Sum(ctx context.Context, req *pb.SumRequest) (*pb.SumReply, error) {
4444 _, rep, err := s.sum.ServeGRPC(ctx, req)
45 return rep.(*pb.SumReply), err
45 if err != nil {
46 return nil, err
47 }
48 return rep.(*pb.SumReply), nil
4649 }
4750
4851 func (s *grpcServer) Concat(ctx context.Context, req *pb.ConcatRequest) (*pb.ConcatReply, error) {
4952 _, rep, err := s.concat.ServeGRPC(ctx, req)
50 return rep.(*pb.ConcatReply), err
53 if err != nil {
54 return nil, err
55 }
56 return rep.(*pb.ConcatReply), nil
5157 }
5258
5359 // DecodeGRPCSumRequest is a transport/grpc.DecodeRequestFunc that converts a