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
There are two pieces of information that are dropped during encoding: text drops location (this is documented in godoc), and both drop monotonic clock information. I assume the former was an unfortunate consequence of using time.RFC3339Nano, but due to hyrum's law you just documented the failure. As such, I would request this too be documented, since it caught me off guard, and I assume that it is infeasible to change.
The text was updated successfully, but these errors were encountered:
Because the monotonic clock reading has no meaning outside the current process, the serialized forms generated by t.GobEncode, t.MarshalBinary, t.MarshalJSON, and t.MarshalText omit the monotonic clock reading, and t.Format provides no format for it. Similarly, the constructors time.Date, time.Parse, time.ParseInLocation, and time.Unix, as well as the unmarshalers t.GobDecode, t.UnmarshalBinary. t.UnmarshalJSON, and t.UnmarshalText always create times with no monotonic clock reading.
somewhat derivative, but what is the suggestion for interface boundaries within a process? is there a way to persist this monotonic information, say cgo or reflective use cases like testing.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/xLZ0iwRQ0qu
What did you expect to see?
What did you see instead?
Summary
There are two pieces of information that are dropped during encoding: text drops location (this is documented in godoc), and both drop monotonic clock information. I assume the former was an unfortunate consequence of using
time.RFC3339Nano
, but due to hyrum's law you just documented the failure. As such, I would request this too be documented, since it caught me off guard, and I assume that it is infeasible to change.The text was updated successfully, but these errors were encountered: