You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jingo currently can't serialize time.Time. By default it will serialize to {}, and using stringify it won't give a proper ISO8601 (?) representation.
I've attempted to work around this using a fallback to the json.Marshaller interface (see #13 ) but explicitly supporting time.Time is more efficient and probably as effective.
The text was updated successfully, but these errors were encountered:
The Time package already offers support for AppendFormat([]byte, layout string) []byte, so if we had 1st class support we would be able to do so without the additional alloc needed by MarshalJSON.
I propose adding ptrTimeToBuf(unsafe.Pointer, *Buffer) to ptrconvert.go then adding a hook within the encoders to use that for time.Time.
The function would behave the same way the rest of the append functions in that file behave and would nominate time.RFC3339Nano as the layout. This then puts the output in-line with what you may expect from JSON.stringify within a browser.
jingo currently can't serialize time.Time. By default it will serialize to
{}
, and using stringify it won't give a proper ISO8601 (?) representation.I've attempted to work around this using a fallback to the json.Marshaller interface (see #13 ) but explicitly supporting time.Time is more efficient and probably as effective.
The text was updated successfully, but these errors were encountered: