Prefer []string{} to []string(nil)

This commit is contained in:
Aren Patel 2017-02-03 14:48:06 -08:00
parent 6e6258e1ab
commit 1d32e9110b
1 changed files with 1 additions and 1 deletions

View File

@ -306,7 +306,7 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
continue
}
if fieldValue.Type() == reflect.TypeOf([]string(nil)) {
if fieldValue.Type() == reflect.TypeOf([]string{}) {
values := make([]string, v.Len())
for i := 0; i < v.Len(); i++ {
values[i] = v.Index(i).Interface().(string)