mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
Use custom-defined type generators for slice elements in compatibility objects
This commit is contained in:
parent
688f5babba
commit
9997683ba2
@ -110,7 +110,11 @@ func fill(dataString string, dataInt int, t reflect.Type, v reflect.Value, fillF
|
|||||||
// populate with a single-item slice
|
// populate with a single-item slice
|
||||||
v.Set(reflect.MakeSlice(t, 1, 1))
|
v.Set(reflect.MakeSlice(t, 1, 1))
|
||||||
// recurse to populate the item, preserving the data context
|
// recurse to populate the item, preserving the data context
|
||||||
fill(dataString, dataInt, t.Elem(), v.Index(0), fillFuncs, filledTypes)
|
if t.Elem().Kind() == reflect.Pointer {
|
||||||
|
fill(dataString, dataInt, t.Elem(), v.Index(0), fillFuncs, filledTypes)
|
||||||
|
} else {
|
||||||
|
fill(dataString, dataInt, reflect.PointerTo(t.Elem()), v.Index(0).Addr(), fillFuncs, filledTypes)
|
||||||
|
}
|
||||||
|
|
||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
// construct the key, which must be a string type, possibly converted to a type alias of string
|
// construct the key, which must be a string type, possibly converted to a type alias of string
|
||||||
|
Loading…
Reference in New Issue
Block a user