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
This library currently encodes and decodes time.Duration values as strings. This deviates from the stdlib, as the type time.Duration does not implement json.Marshaller and is treated as an int64 instead.
Since this library implements this custom logic for both encode and decode, using it on both sides of an exchange of data is no problem. However, when interacting with other decoders (including the stdlib, but also extends to other languages/tools) the difference can be breaking.
My understanding is that this particular behavior is relied on heavily within Segment, so simply changing it to adhere strictly to the stdlib will be breaking for us.
There is currently no way to turn this functionality off, so in the short-term we should expose a config flag to support this. Over the long-term though, matching the stdlib should be the default and the flag should instead enable this additional functionality.
The text was updated successfully, but these errors were encountered:
This library currently encodes and decodes
time.Duration
values as strings. This deviates from the stdlib, as the typetime.Duration
does not implementjson.Marshaller
and is treated as anint64
instead.Since this library implements this custom logic for both encode and decode, using it on both sides of an exchange of data is no problem. However, when interacting with other decoders (including the stdlib, but also extends to other languages/tools) the difference can be breaking.
My understanding is that this particular behavior is relied on heavily within Segment, so simply changing it to adhere strictly to the stdlib will be breaking for us.
There is currently no way to turn this functionality off, so in the short-term we should expose a config flag to support this. Over the long-term though, matching the stdlib should be the default and the flag should instead enable this additional functionality.
The text was updated successfully, but these errors were encountered: