Skip to content

Commit ece292d

Browse files
committed
Docs
1 parent 4d6b0d0 commit ece292d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Translates JSON into a Go type definition. [Check it out!](http://mholt.github.i
55
Things 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

1011
Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change.

json-to-go.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)