changed the unmarshalling behaviour for unmarshalling {"key": []} into map[string]interface{}. The value for "key" in the map will be an empty slice instead of a nil slice.

This commit is contained in:
Muxian Wu
2018-09-27 15:16:26 +08:00
parent 60711f1a83
commit 0aa3c88d86
+1 -1
View File
@@ -1151,7 +1151,7 @@ func (r *Lexer) Interface() interface{} {
} else if r.token.delimValue == '[' {
r.consume()
var ret []interface{}
ret := []interface{}{}
for !r.IsDelim(']') {
ret = append(ret, r.Interface())
r.WantComma()