1
0
mirror of https://github.com/rancher/norman.git synced 2025-08-28 20:01:22 +00:00

Merge pull request #382 from rmweir/empty-array-fix

Differentiate between empty and nil arrays
This commit is contained in:
Darren Shepherd 2020-08-20 15:53:44 -07:00 committed by GitHub
commit b715968cde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -447,6 +447,10 @@ func (b *Builder) convertArray(fieldType string, value interface{}, op Operation
}
var result []interface{}
if value == nil {
return result, nil
}
result = make([]interface{}, 0)
subType := definition.SubType(fieldType)
for _, value := range sliceValue {