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
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))