阅读背景:

处理自定义BSON编组(Golang & mgo)

来源:互联网 

I have a number of structs that require custom marshalling. When I was testing I was using JSON and the standard JSON marshaller. As it doesn't marshal unexported fields, I needed to write a custom MarshalJSON function, which worked perfectly. When I called json.Marshal on the parent struct containing the ones that needed custom marshalling as fields, it worked fine.I have a number of structs that require custom




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: