This commit is contained in:
Masaaki Goshima 2020-08-25 11:18:01 +09:00
parent a9b9597c2e
commit 18a8684873
2 changed files with 2 additions and 1 deletions

View File

@ -165,7 +165,7 @@ func (d *interfaceDecoder) decode(buf []byte, cursor int64, p uintptr) (int64, e
cursor++
*(*interface{})(unsafe.Pointer(p)) = *(*string)(unsafe.Pointer(&literal))
return cursor, nil
case '\000':
case nul:
return 0, errUnexpectedEndOfJSON("string", cursor)
}
cursor++

View File

@ -199,6 +199,7 @@ func TestIndentErrors(t *testing.T) {
}
func diff(t *testing.T, a, b []byte) {
t.Helper()
for i := 0; ; i++ {
if i >= len(a) || i >= len(b) || a[i] != b[i] {
j := i - 10