MCPcopy Create free account
hub / github.com/protocolbuffers/protobuf-go / newError

Method newError

encoding/protojson/decode.go:105–109  ·  view source on GitHub ↗

newError returns an error object with position info.

(pos int, f string, x ...any)

Source from the content-addressed store, hash-verified

103
104// newError returns an error object with position info.
105func (d decoder) newError(pos int, f string, x ...any) error {
106 line, column := d.Position(pos)
107 head := fmt.Sprintf("(line %d:%d): ", line, column)
108 return errors.New(head+f, x...)
109}
110
111// unexpectedTokenError returns a syntax error for the given unexpected token.
112func (d decoder) unexpectedTokenError(tok json.Token) error {

Callers 12

unmarshalAnyMethod · 0.95
unmarshalAnyValueMethod · 0.95
unmarshalEmptyMethod · 0.95
unmarshalKnownValueMethod · 0.95
unmarshalDurationMethod · 0.95
unmarshalTimestampMethod · 0.95
unmarshalFieldMaskMethod · 0.95
unmarshalMessageMethod · 0.95
unmarshalScalarMethod · 0.95
unmarshalMapMethod · 0.95
unmarshalMapKeyMethod · 0.95
findTypeURLFunction · 0.45

Calls 2

NewFunction · 0.92
PositionMethod · 0.45

Tested by

no test coverage detected