forked from mirror/go-json
Compare commits
1 Commits
master
...
feature/im
Author | SHA1 | Date |
---|---|---|
Masaaki Goshima | 397b667f34 |
|
@ -28,8 +28,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
func unmarshal(data []byte, v interface{}) error {
|
func unmarshal(data []byte, v interface{}) error {
|
||||||
src := make([]byte, len(data)+1) // append nul byte to the end
|
src := append(data, nul) // append nul byte to the end
|
||||||
copy(src, data)
|
|
||||||
|
|
||||||
header := (*emptyInterface)(unsafe.Pointer(&v))
|
header := (*emptyInterface)(unsafe.Pointer(&v))
|
||||||
|
|
||||||
|
@ -47,8 +46,7 @@ func unmarshal(data []byte, v interface{}) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func unmarshalNoEscape(data []byte, v interface{}) error {
|
func unmarshalNoEscape(data []byte, v interface{}) error {
|
||||||
src := make([]byte, len(data)+1) // append nul byte to the end
|
src := append(data, nul) // append nul byte to the end
|
||||||
copy(src, data)
|
|
||||||
|
|
||||||
header := (*emptyInterface)(unsafe.Pointer(&v))
|
header := (*emptyInterface)(unsafe.Pointer(&v))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue