interface{} parameter
例如,我使用net/RPC混淆
界面:
// description: Call invokes the named function, waits for it to complete, and returns its error status.
func (client *Client) Call(serviceMethod string, args interface{}, reply interface{}) error
rpc call error:reading body gob: attempt to decode into a non-pointer
所以如何区分何时应该传递指针或传递接口的值。