messagepack结构体中,map的key只能为string。 如: //go:generate msgp type TestStruct struct { TestMap map[string]int } 若为 //go:generate msgp type TestStruct struct { TestMap map[int]int } 在RPC调用时会造成数据丢失
messagepack结构体中,map的key只能为string。
如:
//go:generate msgp
type TestStruct struct {
TestMap map[string]int
}
若为
//go:generate msgp
type TestStruct struct {
TestMap map[int]int
}
在RPC调用时会造成数据丢失