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.
1 parent db97bb7 commit f5cbf55Copy full SHA for f5cbf55
json-to-go.js
@@ -92,6 +92,9 @@ function jsonToGo(json, typename)
92
93
parseStruct(struct, omitempty); // finally parse the struct !!
94
}
95
+ else if (sliceType == "slice") {
96
+ parseScope(scope[0])
97
+ }
98
else
99
append(sliceType || "interface{}");
100
@@ -181,9 +184,9 @@ function jsonToGo(json, typename)
181
184
case "boolean":
182
185
return "bool";
183
186
case "object":
187
+ if (Array.isArray(val))
188
+ return "slice";
189
return "struct";
- case "array":
- return "slice";
190
default:
191
return "interface{}";
192
0 commit comments