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

Method newSyntaxError

internal/encoding/json/decode.go:217–221  ·  view source on GitHub ↗

newSyntaxError returns an error with line and column information useful for syntax errors.

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

Source from the content-addressed store, hash-verified

215// newSyntaxError returns an error with line and column information useful for
216// syntax errors.
217func (d *Decoder) newSyntaxError(pos int, f string, x ...any) error {
218 e := errors.New(f, x...)
219 line, column := d.Position(pos)
220 return errors.New("syntax error (line %d:%d): %v", line, column, e)
221}
222
223// Position returns line and column number of given index of the original input.
224// It will panic if index is out of range.

Callers 3

parseStringMethod · 0.95
ReadMethod · 0.95
parseNextMethod · 0.95

Calls 2

PositionMethod · 0.95
NewFunction · 0.92

Tested by

no test coverage detected