forked from Mirrors/jsonapi
Prefer []string{} to []string(nil)
This commit is contained in:
parent
6e6258e1ab
commit
1d32e9110b
|
@ -306,7 +306,7 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if fieldValue.Type() == reflect.TypeOf([]string(nil)) {
|
if fieldValue.Type() == reflect.TypeOf([]string{}) {
|
||||||
values := make([]string, v.Len())
|
values := make([]string, v.Len())
|
||||||
for i := 0; i < v.Len(); i++ {
|
for i := 0; i < v.Len(); i++ {
|
||||||
values[i] = v.Index(i).Interface().(string)
|
values[i] = v.Index(i).Interface().(string)
|
||||||
|
|
Loading…
Reference in New Issue