diff options
Diffstat (limited to 'src/encoding/json/decode_test.go')
| -rw-r--r-- | src/encoding/json/decode_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/encoding/json/decode_test.go b/src/encoding/json/decode_test.go index 752825cffe..71895a9bb1 100644 --- a/src/encoding/json/decode_test.go +++ b/src/encoding/json/decode_test.go @@ -898,6 +898,19 @@ var unmarshalTests = []struct { }, }, + { + CaseName: Name(""), + in: `{"Level1a": "hello"}`, + ptr: new(Top), + err: &UnmarshalTypeError{ + Value: "string", + Struct: "Top", + Field: "Embed0a.Level1a", + Type: reflect.TypeFor[int](), + Offset: 10, + }, + }, + // issue 15146. // invalid inputs in wrongStringTests below. {CaseName: Name(""), in: `{"B":"true"}`, ptr: new(B), out: B{true}, golden: true}, |
