Merge pull request #106786 from kidlj/fix_mapToUnstructured_error_message
fix mapToUnstructured error message: should be 'map' instead of 'struct' being converted
This commit is contained in:
@@ -722,7 +722,7 @@ func mapToUnstructured(sv, dv reflect.Value) error {
|
|||||||
dt = dv.Type()
|
dt = dv.Type()
|
||||||
}
|
}
|
||||||
if dt.Kind() != reflect.Map {
|
if dt.Kind() != reflect.Map {
|
||||||
return fmt.Errorf("cannot convert struct to: %v", dt.Kind())
|
return fmt.Errorf("cannot convert map to: %v", dt.Kind())
|
||||||
}
|
}
|
||||||
|
|
||||||
if !st.Key().AssignableTo(dt.Key()) && !st.Key().ConvertibleTo(dt.Key()) {
|
if !st.Key().AssignableTo(dt.Key()) && !st.Key().ConvertibleTo(dt.Key()) {
|
||||||
|
Reference in New Issue
Block a user