Skip to content

Commit ee08347

Browse files
committed
Better handling missing type name
1 parent 1fbb675 commit ee08347

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

json-to-go.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,11 @@ function jsonToGo(json, typename)
2727
};
2828
}
2929

30-
typename = format(typename);
31-
32-
if (!typename)
33-
typename = "GIVE_ME_A_NAME";
34-
30+
typename = format(typename || "GIVE_ME_A_NAME");
3531
append("type "+typename+" ");
3632

3733
parseScope(scope);
38-
34+
3935
return { go: go };
4036

4137

0 commit comments

Comments
 (0)