You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-07-03 23:30:41 +02:00
Use json.Number as the return
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
package jsoniter
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// ValueType the type for JSON element
|
||||
@ -274,7 +276,8 @@ func (iter *Iterator) Read() interface{} {
|
||||
return iter.ReadString()
|
||||
case Number:
|
||||
if iter.cfg.configBeforeFrozen.UseNumber {
|
||||
return iter.ReadInt()
|
||||
num := iter.ReadInt64()
|
||||
return json.Number(strconv.FormatInt(num, 10))
|
||||
}
|
||||
return iter.ReadFloat64()
|
||||
case Nil:
|
||||
|
Reference in New Issue
Block a user