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

Method checkForColon

proto/text_decode.go:475–487  ·  view source on GitHub ↗

Consume a ':' from the input stream (if the next token is a colon), returning an error if a colon is needed but not present.

(fd protoreflect.FieldDescriptor)

Source from the content-addressed store, hash-verified

473// Consume a ':' from the input stream (if the next token is a colon),
474// returning an error if a colon is needed but not present.
475func (p *textParser) checkForColon(fd protoreflect.FieldDescriptor) *ParseError {
476 tok := p.next()
477 if tok.err != nil {
478 return tok.err
479 }
480 if tok.value != ":" {
481 if fd.Message() == nil {
482 return p.errorf("expected ':', found %q", tok.value)
483 }
484 p.back()
485 }
486 return nil
487}
488
489// consumeExtensionOrAnyName consumes an extension name or an Any type URL and
490// the following ']'. It returns the name or URL consumed.

Callers 3

unmarshalMessageMethod · 0.95
unmarshalValueMethod · 0.95

Calls 3

nextMethod · 0.95
errorfMethod · 0.95
backMethod · 0.95

Tested by

no test coverage detected