Merge pull request #13675 from kokes/parser_next_doc

docs: textparse.Parser return type mismatch
This commit is contained in:
Julien 2024-03-04 16:19:53 +01:00 committed by GitHub
commit c0cbb8082b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -71,8 +71,8 @@ type Parser interface {
// if the scrape protocol or metric type does not support created timestamps.
CreatedTimestamp() *int64
// Next advances the parser to the next sample. It returns false if no
// more samples were read or an error occurred.
// Next advances the parser to the next sample.
// It returns (EntryInvalid, io.EOF) if no samples were read.
Next() (Entry, error)
}

View file

@ -239,8 +239,8 @@ func (p *OpenMetricsParser) parseError(exp string, got token) error {
return fmt.Errorf("%s, got %q (%q) while parsing: %q", exp, p.l.b[p.l.start:e], got, p.l.b[p.start:e])
}
// Next advances the parser to the next sample. It returns false if no
// more samples were read or an error occurred.
// Next advances the parser to the next sample.
// It returns (EntryInvalid, io.EOF) if no samples were read.
func (p *OpenMetricsParser) Next() (Entry, error) {
var err error

View file

@ -280,8 +280,8 @@ func (p *PromParser) parseError(exp string, got token) error {
return fmt.Errorf("%s, got %q (%q) while parsing: %q", exp, p.l.b[p.l.start:e], got, p.l.b[p.start:e])
}
// Next advances the parser to the next sample. It returns false if no
// more samples were read or an error occurred.
// Next advances the parser to the next sample.
// It returns (EntryInvalid, io.EOF) if no samples were read.
func (p *PromParser) Next() (Entry, error) {
var err error