MCPcopy
hub / github.com/grpc/grpc-go / callUnaryEcho

Function callUnaryEcho

examples/features/health/client/main.go:45–54  ·  view source on GitHub ↗
(c pb.EchoClient)

Source from the content-addressed store, hash-verified

43}`
44
45func callUnaryEcho(c pb.EchoClient) {
46 ctx, cancel := context.WithTimeout(context.Background(), time.Second)
47 defer cancel()
48 r, err := c.UnaryEcho(ctx, &pb.EchoRequest{})
49 if err != nil {
50 fmt.Println("UnaryEcho: _, ", err)
51 } else {
52 fmt.Println("UnaryEcho: ", r.GetMessage())
53 }
54}
55
56func main() {
57 flag.Parse()

Callers 1

mainFunction · 0.70

Calls 3

PrintlnMethod · 0.80
UnaryEchoMethod · 0.65
GetMessageMethod · 0.45

Tested by

no test coverage detected