@@ -82,7 +82,7 @@ func (fk *FieldKey) Field() string {
82
82
}
83
83
84
84
// NewItemKey returns a pair of a slice and index usable as a key of a map.
85
- func NewItemKey (slice [] interface {}, i int ) ItemKey {
85
+ func NewItemKey (slice interface {}, i int ) ItemKey {
86
86
return ItemKey {slice : reflect .ValueOf (slice ), index : i }
87
87
}
88
88
@@ -103,7 +103,7 @@ type fieldSchemata struct {
103
103
}
104
104
105
105
type itemSchemata struct {
106
- slice [] interface {}
106
+ slice reflect. Value
107
107
index int
108
108
schemata schemata
109
109
}
@@ -196,15 +196,15 @@ func (r *Result) mergeForField(obj map[string]interface{}, field string, other *
196
196
}
197
197
198
198
// mergeForSlice merges other into r, assigning other's root schemata to the given slice and index.
199
- func (r * Result ) mergeForSlice (slice [] interface {} , i int , other * Result ) * Result {
199
+ func (r * Result ) mergeForSlice (slice reflect. Value , i int , other * Result ) * Result {
200
200
if other == nil {
201
201
return r
202
202
}
203
203
r .mergeWithoutRootSchemata (other )
204
204
205
205
if other .rootObjectSchemata .Len () > 0 {
206
206
if r .itemSchemata == nil {
207
- r .itemSchemata = make ([]itemSchemata , len ( slice ))
207
+ r .itemSchemata = make ([]itemSchemata , slice . Len ( ))
208
208
}
209
209
r .itemSchemata = append (r .itemSchemata , itemSchemata {
210
210
slice : slice ,
@@ -233,9 +233,9 @@ func (r *Result) addPropertySchemata(obj map[string]interface{}, fld string, sch
233
233
234
234
// addSliceSchemata adds the given schemata for the slice and index.
235
235
// The slice schemata might be reused. I.e. do not modify it after being added to a result.
236
- func (r * Result ) addSliceSchemata (slice [] interface {} , i int , schema * spec.Schema ) {
236
+ func (r * Result ) addSliceSchemata (slice reflect. Value , i int , schema * spec.Schema ) {
237
237
if r .itemSchemata == nil {
238
- r .itemSchemata = make ([]itemSchemata , 0 , len ( slice ))
238
+ r .itemSchemata = make ([]itemSchemata , 0 , slice . Len ( ))
239
239
}
240
240
r .itemSchemata = append (r .itemSchemata , itemSchemata {slice : slice , index : i , schemata : schemata {one : schema }})
241
241
}
0 commit comments