Skip to content

Instantly share code, notes, and snippets.

@nodirt
Created February 8, 2016 03:18
Show Gist options
  • Save nodirt/9911b0ff27b9787a0501 to your computer and use it in GitHub Desktop.
Save nodirt/9911b0ff27b9787a0501 to your computer and use it in GitHub Desktop.
type greeterService struct{}
func (s *greeterService) SayHello(c context.Context, req *helloworld.HelloRequest) (*helloworld.HelloReply, error) {
if req.Name == "" {
return nil, grpc.Errorf(codes.InvalidArgument, "Name unspecified")
}
return &helloworld.HelloReply{
Message: "Hello " + req.Name,
}, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment