如何使用 Threft struct 定义 mgo 的 objectId?
資深大佬 : Zach369 33
我遇到了这样一个问题:
我需要生成的 go struct 是:
type Base struct { ID bson.ObjectId `bson:"_id" json:"id,omitempty"` }
但是 thrift,我不知道怎么写?
struct Base { 1:? ID (go.tag = 'bson:"_id" json:"id,omitempty"') }
bson.ObjectId 是 github.com/globalsign/mgo/bson 的内容
有使用过 threft 生成 go 的 struct 的吗? mongodb 的 objectId 如何处理那?
大佬有話說 (4)