-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding/toml: support decoding timestamps
Given that the CUE language does not have time or date literals, and instead treats timestamps as either strings or numbers, we decode the string-like TOML timestamps as CUE strings. However, we still need to differentiate timestamps like the local time foo = 07:32:00 from the string foo = "07:32:00" so that the user may know which to treat as a timestamp, and so that the encoding/toml package can roundtrip without converting TOML timestamps to strings, or vice versa. For this reason, decode TOML timestamps as a unification with pkg/time's Format validator, with the correct format string per the TOML spec. Note that example.txtar has position diff noise as we add an import. Fixes #3345. Signed-off-by: Daniel Martí <[email protected]> Change-Id: If17dc3b87f95179a956acf004fbf8e37abf2b376 Dispatch-Trailer: {"type":"trybot","CL":1200888,"patchset":1,"ref":"refs/changes/88/1200888/1","targetBranch":"master"}
- Loading branch information
Showing
3 changed files
with
113 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters