Skip to content

Commit 5784acb

Browse files
authored
Fix generation with overrides by skip unexported fields (#15760)
1 parent 662ef2d commit 5784acb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mmv1/api/product.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@ func Merge(self, otherObj reflect.Value, version string) {
305305

306306
for i := 0; i < selfObj.NumField(); i++ {
307307

308+
// skip unexported fields
309+
if !selfObj.Field(i).CanSet() {
310+
continue
311+
}
312+
308313
// skip if the override is the "empty" value
309314
emptyOverrideValue := reflect.DeepEqual(reflect.Zero(otherObj.Field(i).Type()).Interface(), otherObj.Field(i).Interface())
310315

0 commit comments

Comments
 (0)