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

Method readingHelp

expfmt/text_parse.go:500–511  ·  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

498// readingHelp represents the state where the last byte read (now in
499// p.currentByte) is the first byte of the docstring after 'HELP'.
500func (p *TextParser) readingHelp() stateFn {
501 if p.currentMF.Help != nil {
502 p.parseError(fmt.Sprintf("second HELP line for metric name %q", p.currentMF.GetName()))
503 return nil
504 }
505 // Rest of line is the docstring.
506 if p.readTokenUntilNewline(true); p.err != nil {
507 return nil // Unexpected end of input.
508 }
509 p.currentMF.Help = proto.String(p.currentToken.String())
510 return p.startOfLine
511}
512
513// readingType represents the state where the last byte read (now in
514// 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