MCPcopy
hub / github.com/golang/protobuf / consumeOptionalSeparator

Method consumeOptionalSeparator

proto/text_decode.go:523–532  ·  view source on GitHub ↗

consumeOptionalSeparator consumes an optional semicolon or comma. It is used in unmarshalMessage to provide backward compatibility.

()

Source from the content-addressed store, hash-verified

521// consumeOptionalSeparator consumes an optional semicolon or comma.
522// It is used in unmarshalMessage to provide backward compatibility.
523func (p *textParser) consumeOptionalSeparator() error {
524 tok := p.next()
525 if tok.err != nil {
526 return tok.err
527 }
528 if tok.value != ";" && tok.value != "," {
529 p.back()
530 }
531 return nil
532}
533
534func (p *textParser) errorf(format string, a ...interface{}) *ParseError {
535 pe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset}

Callers 3

unmarshalMessageMethod · 0.95
unmarshalValueMethod · 0.95

Calls 2

nextMethod · 0.95
backMethod · 0.95

Tested by

no test coverage detected