From 72cc4707807934ebee1ca65653a22cd0d42145f1 Mon Sep 17 00:00:00 2001 From: yuanhao Date: Tue, 23 Nov 2021 19:46:05 +0800 Subject: [PATCH] reply is *string not string --- ch4-rpc/ch4-03-netrpc-hack.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ch4-rpc/ch4-03-netrpc-hack.md b/ch4-rpc/ch4-03-netrpc-hack.md index 014fd7f..d6bdb74 100644 --- a/ch4-rpc/ch4-03-netrpc-hack.md +++ b/ch4-rpc/ch4-03-netrpc-hack.md @@ -32,8 +32,8 @@ func doClientWork(client *rpc.Client) { } args := helloCall.Args.(string) - reply := helloCall.Reply.(string) - fmt.Println(args, reply) + reply := helloCall.Reply.(*string) + fmt.Println(args, *reply) } ``` @@ -246,7 +246,7 @@ func doClientWork(clientChan <-chan *rpc.Client) { defer client.Close() var reply string - err = client.Call("HelloService.Hello", "hello", &reply) + err := client.Call("HelloService.Hello", "hello", &reply) if err != nil { log.Fatal(err) }