forked from mirror/go-json
Refactor
This commit is contained in:
parent
a9b9597c2e
commit
18a8684873
|
@ -165,7 +165,7 @@ func (d *interfaceDecoder) decode(buf []byte, cursor int64, p uintptr) (int64, e
|
||||||
cursor++
|
cursor++
|
||||||
*(*interface{})(unsafe.Pointer(p)) = *(*string)(unsafe.Pointer(&literal))
|
*(*interface{})(unsafe.Pointer(p)) = *(*string)(unsafe.Pointer(&literal))
|
||||||
return cursor, nil
|
return cursor, nil
|
||||||
case '\000':
|
case nul:
|
||||||
return 0, errUnexpectedEndOfJSON("string", cursor)
|
return 0, errUnexpectedEndOfJSON("string", cursor)
|
||||||
}
|
}
|
||||||
cursor++
|
cursor++
|
||||||
|
|
|
@ -199,6 +199,7 @@ func TestIndentErrors(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func diff(t *testing.T, a, b []byte) {
|
func diff(t *testing.T, a, b []byte) {
|
||||||
|
t.Helper()
|
||||||
for i := 0; ; i++ {
|
for i := 0; ; i++ {
|
||||||
if i >= len(a) || i >= len(b) || a[i] != b[i] {
|
if i >= len(a) || i >= len(b) || a[i] != b[i] {
|
||||||
j := i - 10
|
j := i - 10
|
||||||
|
|
Loading…
Reference in New Issue