jsontoml tool (#296)

`jsontoml` is very similar to `tomljson`
It uses json.Unmarshal to convert read json to map and then
converts the map to tree using `toml.TreeFromMap`.
Then this tree is converted to toml using `tree.toTomlString()`
The numbers when taken as input from json get converted to float64
because of how `json.Unmarshal()` converts all json numbers to float.

Fixes #280
This commit is contained in:
Gaurav Dhameeja
2019-09-06 22:06:56 +05:30
committed by Thomas Pelletier
parent 3ded2e09ee
commit 4d5afd743f
7 changed files with 188 additions and 0 deletions
+7
View File
@@ -100,6 +100,13 @@ Go-toml provides two handy command line tools:
go install github.com/pelletier/go-toml/cmd/tomljson
tomljson --help
```
* `jsontoml`: Reads a JSON file and outputs a TOML representation.
```
go install github.com/pelletier/go-toml/cmd/jsontoml
jsontoml --help
```
### Docker image