Skip to content

Commit 0a10c6f

Browse files
committed
interface{} -> any
1 parent 2b15550 commit 0a10c6f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

json-to-go.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function jsonToGo(json, typename, flatten = true, example = false, allOmitempty
6262
else if (sliceType != thisType)
6363
{
6464
sliceType = mostSpecificPossibleGoType(thisType, sliceType);
65-
if (sliceType == "interface{}")
65+
if (sliceType == "any")
6666
break;
6767
}
6868
}
@@ -130,9 +130,9 @@ function jsonToGo(json, typename, flatten = true, example = false, allOmitempty
130130
}
131131
else {
132132
if (flatten && depth >= 2) {
133-
appender(sliceType || "interface{}");
133+
appender(sliceType || "any");
134134
} else {
135-
append(sliceType || "interface{}");
135+
append(sliceType || "any");
136136
}
137137
}
138138
}
@@ -316,7 +316,7 @@ function jsonToGo(json, typename, flatten = true, example = false, allOmitempty
316316
function goType(val)
317317
{
318318
if (val === null)
319-
return "interface{}";
319+
return "any";
320320

321321
switch (typeof val)
322322
{
@@ -342,7 +342,7 @@ function jsonToGo(json, typename, flatten = true, example = false, allOmitempty
342342
return "slice";
343343
return "struct";
344344
default:
345-
return "interface{}";
345+
return "any";
346346
}
347347
}
348348

@@ -356,7 +356,7 @@ function jsonToGo(json, typename, flatten = true, example = false, allOmitempty
356356
&& typ2.substr(0, 5) == "float")
357357
return typ2;
358358
else
359-
return "interface{}";
359+
return "any";
360360
}
361361

362362
// Proper cases a string according to Go conventions

0 commit comments

Comments
 (0)