mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-23 20:02:22 +00:00
Merge pull request #558 from howieyuen/ch04-3
reply is *string not string
This commit is contained in:
commit
aa6cb03719
@ -32,8 +32,8 @@ func doClientWork(client *rpc.Client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
args := helloCall.Args.(string)
|
args := helloCall.Args.(string)
|
||||||
reply := helloCall.Reply.(string)
|
reply := helloCall.Reply.(*string)
|
||||||
fmt.Println(args, reply)
|
fmt.Println(args, *reply)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ func doClientWork(clientChan <-chan *rpc.Client) {
|
|||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
|
||||||
var reply string
|
var reply string
|
||||||
err = client.Call("HelloService.Hello", "hello", &reply)
|
err := client.Call("HelloService.Hello", "hello", &reply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user