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

Method readTokenUntilWhitespace

expfmt/text_parse.go:564–570  ·  view source on GitHub ↗

readTokenUntilWhitespace copies bytes from p.buf into p.currentToken. The first byte considered is the byte already read (now in p.currentByte). The first whitespace byte encountered is still copied into p.currentByte, but not into p.currentToken.

()

Source from the content-addressed store, hash-verified

562// first whitespace byte encountered is still copied into p.currentByte, but not
563// into p.currentToken.
564func (p *TextParser) readTokenUntilWhitespace() {
565 p.currentToken.Reset()
566 for p.err == nil && !isBlankOrTab(p.currentByte) && p.currentByte != '\n' {
567 p.currentToken.WriteByte(p.currentByte)
568 p.currentByte, p.err = p.buf.ReadByte()
569 }
570}
571
572// readTokenUntilNewline copies bytes from p.buf into p.currentToken. The first
573// byte considered is the byte already read (now in p.currentByte). The first

Callers 3

startCommentMethod · 0.95
readingValueMethod · 0.95
startTimestampMethod · 0.95

Calls 2

isBlankOrTabFunction · 0.85
WriteByteMethod · 0.80

Tested by

no test coverage detected