Higher fractional second precision #707
Answered
by
pelletier
moorereason
asked this question in
Questions
Replies: 1 comment 1 reply
-
Agreed. I think we should truncate to nanoseconds and note that behavior in godoc. I didn’t realize the spec was prescriptive on what to do for greater than supported precision. I think it’s fair to use nanoseconds as the supported precision because that’s what the standard behavior does. If somebody needs greater precision They can use their own type with custom un/marshaling methods.
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
moorereason
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Situation
While doing differential fuzzing against
toml.dart
, I had a failed case wherego-toml
rejected the input with an error whiletoml.dart
accepted the input as-is:The TOML spec
The Question
Precision beyond milliseconds is implementation specific. Should
go-toml
return an error here or truncate the fractional second to the maximum supported precision (nanoseconds) and move on?My Two Cents
This input is valid TOML. It seems like
go-toml
should parse the document as best it can, but we should make clear in the README and/or godocs that we're limited to nanosecond precision on the fractional second component and will truncate as necessary.Beta Was this translation helpful? Give feedback.
All reactions