File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,12 @@ type CronJobSpec struct {
193
193
// +kubebuilder:validation:XValidation:rule="self.size() % 2 == 0",message="must have even length"
194
194
// +kubebuilder:validation:XValidation:rule="true"
195
195
StringWithEvenLength string `json:"stringWithEvenLength,omitempty"`
196
+
197
+ // Checks that fixed-length arrays work
198
+ Array [3 ]int `json:"array,omitempty"`
199
+
200
+ // Checks that arrays work when the type contains a composite literal
201
+ ArrayUsingCompositeLiteral [len (struct { X [3 ]int }{}.X )]string `json:"arrayUsingCompositeLiteral,omitempty"`
196
202
}
197
203
198
204
type ContainsNestedMap struct {
Original file line number Diff line number Diff line change 35
35
spec:
36
36
description: CronJobSpec defines the desired state of CronJob
37
37
properties:
38
+ array:
39
+ description: Checks that fixed-length arrays work
40
+ items:
41
+ type: integer
42
+ type: array
43
+ arrayUsingCompositeLiteral:
44
+ description: Checks that arrays work when the type contains a composite
45
+ literal
46
+ items:
47
+ type: string
48
+ type: array
38
49
associativeList:
39
50
description: This tests that associative lists work.
40
51
items:
Original file line number Diff line number Diff line change @@ -133,9 +133,14 @@ func (c *referenceCollector) Visit(node ast.Node) ast.Visitor {
133
133
// local reference or dot-import, ignore
134
134
return nil
135
135
case * ast.SelectorExpr :
136
- pkgName := typedNode .X .(* ast.Ident ).Name
137
- c .refs .external (pkgName )
138
- return nil
136
+ switch x := typedNode .X .(type ) {
137
+ case * ast.Ident :
138
+ pkgName := x .Name
139
+ c .refs .external (pkgName )
140
+ return nil
141
+ default :
142
+ return c
143
+ }
139
144
default :
140
145
return c
141
146
}
You can’t perform that action at this time.
0 commit comments