func readResponse(c *clientCodec) error { head := rpc.Response{} if err := c.ReadResponseHeader(&head); err != nil { return err } body := testpb.Result{} if err := c.ReadResponseBody(&body); err != nil { return err } fmt.Printf("head: %v, body: %v\n", head, body.GetTitle()) return nil }