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

Method unexpectedTokenError

encoding/prototext/decode.go:94–96  ·  view source on GitHub ↗

unexpectedTokenError returns a syntax error for the given unexpected token.

(tok text.Token)

Source from the content-addressed store, hash-verified

92
93// unexpectedTokenError returns a syntax error for the given unexpected token.
94func (d decoder) unexpectedTokenError(tok text.Token) error {
95 return d.syntaxError(tok.Pos(), "unexpected token: %s", tok.RawString())
96}
97
98// syntaxError returns a syntax error for given position.
99func (d decoder) syntaxError(pos int, f string, x ...any) error {

Callers 6

unmarshalMessageMethod · 0.95
unmarshalScalarMethod · 0.95
unmarshalListMethod · 0.95
unmarshalMapMethod · 0.95
unmarshalMapEntryMethod · 0.95
unmarshalAnyMethod · 0.95

Calls 3

syntaxErrorMethod · 0.95
PosMethod · 0.45
RawStringMethod · 0.45

Tested by

no test coverage detected