Re: [go-nuts] Re: unmarshal unix time from a json stream is of different format

2016-11-19 Thread Tarmigan
The easiest way is to use struct embedding so that your UnixTime can use the time.Time methods: https://play.golang.org/p/WltVTKxylT On Sat, Nov 19, 2016 at 12:32 AM, Sathish VJ wrote: > That by itself works, but I still haven't figured out how to make a custom > marshal type work automatically i

[go-nuts] Re: unmarshal unix time from a json stream is of different format

2016-11-19 Thread Sathish VJ
That by itself works, but I still haven't figured out how to make a custom marshal type work automatically in both directions. i.e. the streaming part in json is in unix time format but internally it is time.Time. Can we put a custom type in the tag value? Something like this? T time.Time `jso