Hi List!
Is there any way to have a message field be unmarshalled to time.Time? Since I am aware of issue #113 (and #57,respectively), I was trying to find a workaround. I am open to use syntax 2 or 3.
I tried to implement a custom field type being a type alias for time.Time implementing the Marshal and Unmarshal interface and use casttype to have it cast to time.Time, but on generation, this causes an error:
protoc-gen-gogo: error:timestamp cannot be custom type and cast type
The reason for this requirement is that I want to persist the unmarshalled instance into MongoDB, where it is supposed to be processed by the ISODate value time.Time gets marshalled to by mgo.
As a last resort, I could have a type alias for the message and (un)marshal an additional time.Time field for MongoDB's BSON accordingly, but that seems like a rather inelegant solution, hence my question.
Thanks in advance,
Markus