-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds support for encoding json.Number as a number instead of as a string, which is the underlying type of json.Number. Care has been taken to not introduce a dependency on the encoding/json package, by using an interface that specifies the methods of json.Number instead of the datatype itself. This also means that other packages that use a similar datatype will be supported. (Like json-iterator) This is useful for tools that wish to convert JSON data into YAML data by deserializing JSON into a map[string]interface{}, and use the json.Encoder's UseNumber() method, or structs that use the json.Number datatype and also wish to support yaml.
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 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