quicktype-core 23.0.82 → 23.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/language/Golang.js +1 -3
- package/package.json +1 -1
package/dist/language/Golang.js
CHANGED
|
@@ -61,8 +61,6 @@ function isValueType(t) {
|
|
|
61
61
|
function canOmitEmpty(cp) {
|
|
62
62
|
if (!cp.isOptional)
|
|
63
63
|
return false;
|
|
64
|
-
if (exports.goOptions.omitEmpty)
|
|
65
|
-
return true;
|
|
66
64
|
const t = cp.type;
|
|
67
65
|
return ["union", "null", "any"].indexOf(t.kind) < 0;
|
|
68
66
|
}
|
|
@@ -197,7 +195,7 @@ class GoRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
197
195
|
const description = this.descriptionForClassProperty(c, jsonName);
|
|
198
196
|
const docStrings = description !== undefined && description.length > 0 ? description.map(d => "// " + d) : [];
|
|
199
197
|
const goType = this.propertyGoType(p);
|
|
200
|
-
const omitEmpty = canOmitEmpty(p) ? ",omitempty" : [];
|
|
198
|
+
const omitEmpty = canOmitEmpty(p) || this._options.omitEmpty ? ",omitempty" : [];
|
|
201
199
|
docStrings.forEach(doc => columns.push([doc]));
|
|
202
200
|
const tags = this._options.fieldTags
|
|
203
201
|
.split(",")
|