We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 50c19eb + 3a32595 commit 6cb6379Copy full SHA for 6cb6379
json-to-go.js
@@ -42,7 +42,7 @@ function jsonToGo(json, typename)
42
43
function parseScope(scope)
44
{
45
- if (typeof scope === "object")
+ if (typeof scope === "object" && scope !== null)
46
47
if (Array.isArray(scope))
48
@@ -104,6 +104,9 @@ function jsonToGo(json, typename)
104
105
function goType(val)
106
107
+ if (val === null) {
108
+ return "interface{}";
109
+ }
110
switch (typeof val)
111
112
case "string":
@@ -118,6 +121,8 @@ function jsonToGo(json, typename)
118
121
}
119
122
else
120
123
return "float32"
124
+ case "boolean":
125
+ return "bool";
126
case "object":
127
return "struct";
128
case "array":
0 commit comments