Remove Go 1.5-ism to make compilable by go 1.3 & 1.4 - fixes #201

This commit is contained in:
Nick Craig-Wood 2015-11-08 10:42:50 +00:00
parent a4f3548bbf
commit 2c66bdd6bb

View file

@ -71,8 +71,8 @@ type Timestamp time.Time
// MarshalJSON turns a Timestamp into JSON (in UTC) // MarshalJSON turns a Timestamp into JSON (in UTC)
func (t *Timestamp) MarshalJSON() (out []byte, err error) { func (t *Timestamp) MarshalJSON() (out []byte, err error) {
out = (*time.Time)(t).UTC().AppendFormat(out, timeFormat) timeString := (*time.Time)(t).UTC().Format(timeFormat)
return out, nil return []byte(timeString), nil
} }
// UnmarshalJSON turns JSON into a Timestamp // UnmarshalJSON turns JSON into a Timestamp