github.com/zerosnake0/jzon@v0.0.9-0.20230801092939-1b135cb83f7f/decoder_config_adaptor.go (about) 1 package jzon 2 3 // NewIterator returns a new iterator. 4 func (decCfg *DecoderConfig) NewIterator() *Iterator { 5 it := defaultIteratorPool.borrowIterator() 6 it.cfg = decCfg 7 it.useNumber = decCfg.useNumber 8 it.disallowUnknownFields = decCfg.disallowUnknownFields 9 return it 10 } 11 12 func (decCfg *DecoderConfig) returnIterator(it *Iterator) { 13 it.cfg = nil 14 defaultIteratorPool.returnIterator(it) 15 }