You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-15 22:50:24 +02:00
expose Parse from Any
This commit is contained in:
@ -13,15 +13,20 @@ type floatLazyAny struct {
|
||||
cache float64
|
||||
}
|
||||
|
||||
func (any *floatLazyAny) fillCache() {
|
||||
if any.err != nil {
|
||||
return
|
||||
}
|
||||
func (any *floatLazyAny) Parse() *Iterator {
|
||||
iter := any.iter
|
||||
if iter == nil {
|
||||
iter = NewIterator()
|
||||
}
|
||||
iter.ResetBytes(any.buf)
|
||||
return iter
|
||||
}
|
||||
|
||||
func (any *floatLazyAny) fillCache() {
|
||||
if any.err != nil {
|
||||
return
|
||||
}
|
||||
iter := any.Parse()
|
||||
any.cache = iter.ReadFloat64()
|
||||
if iter.Error != io.EOF {
|
||||
iter.reportError("floatLazyAny", "there are bytes left")
|
||||
|
Reference in New Issue
Block a user