mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
Merge pull request #190 from WUMUXIAN/master
changed the unmarshalling behaviour for unmarshalling {"key": []} int…
This commit is contained in:
+1
-1
@@ -1152,7 +1152,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()
|
||||
|
||||
@@ -194,7 +194,7 @@ func TestInterface(t *testing.T) {
|
||||
{toParse: "5", want: float64(5)},
|
||||
|
||||
{toParse: `{}`, want: map[string]interface{}{}},
|
||||
{toParse: `[]`, want: []interface{}(nil)},
|
||||
{toParse: `[]`, want: []interface{}{}},
|
||||
|
||||
{toParse: `{"a": "b"}`, want: map[string]interface{}{"a": "b"}},
|
||||
{toParse: `[5]`, want: []interface{}{float64(5)}},
|
||||
|
||||
Reference in New Issue
Block a user