1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-24 23:16:47 +02:00
This commit is contained in:
Tao Wen
2017-06-29 20:40:25 +08:00
parent fb382c0ec1
commit 1253b8edd3
4 changed files with 28 additions and 28 deletions

View File

@ -57,7 +57,7 @@ func (encoder *arrayEncoder) EncodeInterface(val interface{}, stream *Stream) {
return
}
elemType := encoder.arrayType.Elem()
if encoder.arrayType.Len() == 1 && (elemType.Kind() == reflect.Ptr ||elemType.Kind() == reflect.Map) {
if encoder.arrayType.Len() == 1 && (elemType.Kind() == reflect.Ptr || elemType.Kind() == reflect.Map) {
ptr := uintptr(e.word)
e.word = unsafe.Pointer(&ptr)
}