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

Method unexpectedTokenError

encoding/protojson/decode.go:112–114  ·  view source on GitHub ↗

unexpectedTokenError returns a syntax error for the given unexpected token.

(tok json.Token)

Source from the content-addressed store, hash-verified

110
111// unexpectedTokenError returns a syntax error for the given unexpected token.
112func (d decoder) unexpectedTokenError(tok json.Token) error {
113 return d.syntaxError(tok.Pos(), "unexpected token %s", tok.RawString())
114}
115
116// syntaxError returns a syntax error for given position.
117func (d decoder) syntaxError(pos int, f string, x ...any) error {

Callers 9

unmarshalAnyMethod · 0.95
unmarshalEmptyMethod · 0.95
unmarshalDurationMethod · 0.95
unmarshalTimestampMethod · 0.95
unmarshalFieldMaskMethod · 0.95
unmarshalMethod · 0.95
unmarshalMessageMethod · 0.95
unmarshalListMethod · 0.95
unmarshalMapMethod · 0.95

Calls 3

syntaxErrorMethod · 0.95
PosMethod · 0.45
RawStringMethod · 0.45

Tested by

no test coverage detected