golang错误link reading body gob: attempt to decode into a non-pointer

出错代码:err = client.Call("Math.Add",args,rep)

出错原因:链接采用非指针,

解决方法:改成指针 err = client.Call("Math.Add",&args,&rep)

你可能感兴趣的:(rpc,指针,golang)