File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Translates JSON into a Go type definition. [Check it out!](http://mholt.github.i
55Things to note:
66
77- The script sometimes has to make some assumptions, so give the output a once-over.
8+ - In an array of objects, it is assumed that the first object is representative of the rest of them.
89- The output is indented, but not formatted. Use ` go fmt ` !
910
1011Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change.
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ function jsonToGo(json, typename)
1616
1717 try
1818 {
19- data = JSON . parse ( json . replace ( / \. 0 / g, ".1" ) ) ;
19+ data = JSON . parse ( json . replace ( / \. 0 / g, ".1" ) ) ; // hack that forces floats to stay as floats
2020 scope = data ;
2121 }
2222 catch ( e )
You can’t perform that action at this time.
0 commit comments