MCPcopy
hub / github.com/protocolbuffers/protobuf-go / consumeStringToken

Method consumeStringToken

internal/encoding/json/decode.go:323–332  ·  view source on GitHub ↗

consumeStringToken constructs a Token for a String kind with raw value derived from current d.in and given size.

(s string, size int)

Source from the content-addressed store, hash-verified

321// consumeStringToken constructs a Token for a String kind with raw value derived
322// from current d.in and given size.
323func (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.

Callers 1

parseNextMethod · 0.95

Calls 1

consumeMethod · 0.95

Tested by

no test coverage detected