MCPcopy Create free account
hub / github.com/prometheus/common / readingHelp

Method readingHelp

expfmt/text_parse.go:646–657  ·  view source on GitHub ↗

readingHelp represents the state where the last byte read (now in p.currentByte) is the first byte of the docstring after 'HELP'.

()

Source from the content-addressed store, hash-verified

644// readingHelp represents the state where the last byte read (now in
645// p.currentByte) is the first byte of the docstring after 'HELP'.
646func (p *TextParser) readingHelp() stateFn {
647 if p.currentMF.Help != nil {
648 p.parseError(fmt.Sprintf("second HELP line for metric name %q", p.currentMF.GetName()))
649 return nil
650 }
651 // Rest of line is the docstring.
652 if p.readTokenUntilNewline(true); p.err != nil {
653 return nil // Unexpected end of input.
654 }
655 p.currentMF.Help = proto.String(p.currentToken.String())
656 return p.startOfLine
657}
658
659// readingType represents the state where the last byte read (now in
660// p.currentByte) is the first byte of the type hint after 'HELP'.

Callers

nothing calls this directly

Calls 3

parseErrorMethod · 0.95
readTokenUntilNewlineMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected