Skip to content

Instantly share code, notes, and snippets.

@ruandao
Created July 6, 2018 10:05
Show Gist options
  • Save ruandao/0eb72a685b097b9ab1eddda8d8239a86 to your computer and use it in GitHub Desktop.
Save ruandao/0eb72a685b097b9ab1eddda8d8239a86 to your computer and use it in GitHub Desktop.
rpc call err: gob: type not registered for interface: map[string]interface {} 原因是: args 里面一个字段是interface{}, 然后赋值的时候,赋值为map[string]interface{} 结果就跪了一天。。。。
args := BussinessRPC.ProcessMsg{
UserId: cor.userId,
Message: message,
TimeStamp: time.Now().Format("2006-01-02 15:04:05.000"),
}
reply := &BussinessRPC.ProcessMsgReply{}
service := "FreeStyleGame.Process"
conn, err := rpc.Dial("tcp", address)
if err != nil {
logOnErr(err, "dail fail")
return
}
//args := BussinessRPC.ProcessMsg{}
//reply := &BussinessRPC.ProcessMsgReply{}
err = conn.Call(service, args, reply)
logOnErr(err, "call err")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment