mirror of
https://github.com/json-iterator/go.git
synced 2025-05-13 21:36:29 +02:00
Use readNumberAsString
This commit is contained in:
parent
be9d4ded4f
commit
90137b4a60
@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strconv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ValueType the type for JSON element
|
// ValueType the type for JSON element
|
||||||
@ -276,8 +275,7 @@ func (iter *Iterator) Read() interface{} {
|
|||||||
return iter.ReadString()
|
return iter.ReadString()
|
||||||
case Number:
|
case Number:
|
||||||
if iter.cfg.configBeforeFrozen.UseNumber {
|
if iter.cfg.configBeforeFrozen.UseNumber {
|
||||||
num := iter.ReadInt64()
|
return json.Number(iter.readNumberAsString())
|
||||||
return json.Number(strconv.FormatInt(num, 10))
|
|
||||||
}
|
}
|
||||||
return iter.ReadFloat64()
|
return iter.ReadFloat64()
|
||||||
case Nil:
|
case Nil:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user