More details regarding changes to time.Time JSON marshalling/unmarshalling in 1.20?

134 views
Skip to first unread message

Ben Brcan

unread,
Jan 4, 2023, 2:54:50 AM1/4/23
to golang-nuts
Hi, I noticed this in the draft release notes for 1.20:

The Time.MarshalJSON and Time.UnmarshalJSON methods are now more strict about adherence to RFC 3339.

Can we get some further details about this? Are there things that were OK before that will no longer be valid?

Thank you

Ben

Dan Kortschak

unread,
Jan 4, 2023, 3:10:49 AM1/4/23
to golan...@googlegroups.com

gbarr

unread,
Jan 4, 2023, 3:13:52 AM1/4/23
to golang-nuts
By reading the commit at https://github.com/golang/go/commit/72c58fb77192f7d17d87663c943360a48aae11dc the change that stands out most to me is bounds checking on the hour and minute elements of the time zone offset

Ben Brcan

unread,
Jan 4, 2023, 5:03:46 PM1/4/23
to golang-nuts
That's really helpful, thank you!
Reply all
Reply to author
Forward
0 new messages