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
Copy file name to clipboardExpand all lines: docs/linters.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -523,6 +523,10 @@ Non-pointer structs that contain no required fields are marked as optional.
523
523
This linter is important for types validated in Go as there is no way to validate the optionality of the fields at runtime,
524
524
aside from checking the fields within them.
525
525
526
+
This linter is NOT intended to be used to check for CRD types.
527
+
The advice of this linter may be applied to CRD types, but it is not necessary for CRD types due to optionality being validated by openapi and no native Go code.
528
+
For CRD types, the optionalfields and requiredfields linters should be used instead.
529
+
526
530
If a struct is marked required, this can only be validated by having a required field within it.
527
531
If there are no required fields, the struct is implicitly optional and must be marked as so.
Copy file name to clipboardExpand all lines: pkg/analysis/nonpointerstructs/doc.go
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,10 @@ Non-pointer structs that contain no required fields are marked as optional.
21
21
This linter is important for types validated in Go as there is no way to validate the optionality of the fields at runtime,
22
22
aside from checking the fields within them.
23
23
24
+
This linter is NOT intended to be used to check for CRD types.
25
+
The advice of this linter may be applied to CRD types, but it is not necessary for CRD types due to optionality being validated by openapi and no native Go code.
26
+
For CRD types, the optionalfields and requiredfields linters should be used instead.
27
+
24
28
If a struct is marked required, this can only be validated by having a required field within it.
25
29
If there are no required fields, the struct is implicitly optional and must be marked as so.
0 commit comments