unmarshal should be struct

This commit is contained in:
kevin
2020-09-28 15:19:30 +08:00
parent 12c08bfd39
commit e5d7c3ab04
2 changed files with 12 additions and 0 deletions

View File

@@ -14,6 +14,13 @@ import (
// so we only can test to 62 bits.
const maxUintBitsToTest = 62
func TestUnmarshalWithFullNameNotStruct(t *testing.T) {
var s map[string]interface{}
content := []byte(`{"name":"xiaoming"}`)
err := UnmarshalJsonBytes(content, &s)
assert.Equal(t, errValueNotStruct, err)
}
func TestUnmarshalWithoutTagName(t *testing.T) {
type inner struct {
Optional bool `key:",optional"`