Skip to content

Commit e5931b7

Browse files
committed
If none of field name can be used in name, make name an error message
1 parent 999319e commit e5931b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

json-to-go.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function jsonToGo(json, typename)
107107
'8': "Eight_", '9': "Nine_"};
108108
str = numbers[str.charAt(0)] + str.substr(1);
109109
}
110-
return toProperCase(str).replace(/[^a-z0-9]/ig, "");
110+
return toProperCase(str).replace(/[^a-z0-9]/ig, "") || "NAMING_FAILED";
111111
}
112112

113113
// Determines the most appropriate Go type

0 commit comments

Comments
 (0)