From the course: gRPC in Go

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Solution

Solution

(upbeat music) - [Instructor] Let's have a look at my solution, right? So in the client code cmd, client, main, we create an EndRequest with the request id. It's the same request that was for the StartRequest. We say that the time is now. So this is the end time. And the distance was 1.3 miles. And now we create a context for this call, defer the console, and we call and with this context, an appointer to the request, and we get the response. If there is an error, we fail with an error message. Otherwise we print it. Okay? So let's go to the server and I'm going to run the server. And now let's toggle the terminal. And then we are going to run the cmd client. And we see now that we got two responses, both have the same ID.

Contents