consumeStringToken constructs a Token for a String kind with raw value derived from current d.in and given size.
(s string, size int)
| 321 | // consumeStringToken constructs a Token for a String kind with raw value derived |
| 322 | // from current d.in and given size. |
| 323 | func (d *Decoder) consumeStringToken(s string, size int) Token { |
| 324 | tok := Token{ |
| 325 | kind: String, |
| 326 | raw: d.in[:size], |
| 327 | pos: len(d.orig) - len(d.in), |
| 328 | str: s, |
| 329 | } |
| 330 | d.consume(size) |
| 331 | return tok |
| 332 | } |
| 333 | |
| 334 | // Clone returns a copy of the Decoder for use in reading ahead the next JSON |
| 335 | // object, array or other values without affecting current Decoder. |