You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// structWithMinPropertiesOnStruct is a struct field with a minimum number of properties on the struct.
175
180
// +optional
176
181
StructWithMinPropertiesOnStructD`json:"structWithMinPropertiesOnStruct,omitempty"`// want "field StructWithMinPropertiesOnStruct is optional and should be a pointer"
Copy file name to clipboardExpand all lines: pkg/analysis/optionalfields/testdata/src/b/a.go.golden
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,11 @@ type A struct {
171
171
// +optional
172
172
StructWithMinProperties *B `json:"structWithMinProperties,omitempty"` // want "field StructWithMinProperties is optional and should be a pointer"
173
173
174
+
// StructWithMinPropertiesAndOmitEmptyTag is a struct field with a minimum number of properties.
175
+
// +kubebuilder:validation:MinProperties=1
176
+
// +optional
177
+
StructWithMinPropertiesAndOmitEmptyTag B `json:"structWithMinPropertiesAndOmitEmptyTag,omitempty,omitzero"`
178
+
174
179
// structWithMinPropertiesOnStruct is a struct field with a minimum number of properties on the struct.
175
180
// +optional
176
181
StructWithMinPropertiesOnStruct *D `json:"structWithMinPropertiesOnStruct,omitempty"` // want "field StructWithMinPropertiesOnStruct is optional and should be a pointer"
0 commit comments