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

2016-11-18 Thread Dave Cheney
UnixTime and time.Time are different types with different method sets. UnixTime is not a subclass or a child type of time.Time as there is no such thing as inheritance in go. Try printing this value. time.Time(*t) Dave -- You received this message because you are subscribed to the Googl

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

2016-11-18 Thread Sathish VJ
I'm trying to unmarshal unix time from a json stream. Why is my custom type UnixTime printing a completely different format of the time? Shouldn't it be just a normal time.Time format? type UnixTime time.Time func (t *UnixTime) UnmarshalJSON(b []byte) error { ts, _ := strconv.Atoi(string(b))