File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,8 +134,6 @@ func zeroValueJSONOmitEmptyFilter(cName string) ValueFilter {
134134 return true
135135 case (k == reflect .Slice || k == reflect .Map ) && v .Len () == 0 :
136136 return true
137- case k == reflect .Ptr && v .Elem ().IsZero ():
138- return true
139137 default :
140138 return false
141139 }
Original file line number Diff line number Diff line change @@ -478,14 +478,25 @@ func TestLateInitialize(t *testing.T) {
478478 wantModified : false ,
479479 wantCRObject : & nestedStruct4 {},
480480 },
481- "TestSkipOmitemptyTaggedPtrElem " : {
481+ "TestIncludeZeroValuePtrElem " : {
482482 args : args {
483483 desiredObject : & nestedStruct4 {},
484484 observedObject : & nestedStruct4 {
485485 F1 : & testStringEmpty ,
486486 },
487487 opts : []GenericLateInitializerOption {WithZeroValueJSONOmitEmptyFilter (CNameWildcard )},
488488 },
489+ wantModified : true ,
490+ wantCRObject : & nestedStruct4 {
491+ F1 : & testStringEmpty ,
492+ },
493+ },
494+ "TestSkipNilPtrElem" : {
495+ args : args {
496+ desiredObject : & nestedStruct4 {},
497+ observedObject : & nestedStruct4 {},
498+ opts : []GenericLateInitializerOption {WithZeroValueJSONOmitEmptyFilter (CNameWildcard )},
499+ },
489500 wantModified : false ,
490501 wantCRObject : & nestedStruct4 {},
491502 },
You can’t perform that action at this time.
0 commit comments