mirror of
https://github.com/prometheus/prometheus.git
synced 2025-09-21 05:41:01 +02:00
The docs suggest the Next method returns a bool, but that's not the case (`Entry` is an int). ``` // Next advances the parser to the next sample. It returns false if no // more samples were read or an error occurred. Next() (Entry, error) ``` The docs were first added in d80a3de235b5f1349591420c55925d82ca49204e in 2017. Back then the signature was indeed `func (p *Parser) Next() bool`. But then it got refactored in 76a4a46cb0b78ab5b25f099693e9ddd23860a38d and the signature changed with it, yet docs stayed the same - and eventually made their way into the `Parser` interface. However, the Protobuf parser does have the right wording: 5de2df752f39de05c6ab53a9ec93f797027da0b9 ``` // Next advances the parser to the next "sample" (emulating the behavior of a // text format parser). It returns (EntryInvalid, io.EOF) if no samples were // read. ``` Changing all other implementations (and the interface itself) to match this doc. Signed-off-by: Ondrej Kokes <ondrej.kokes@gmail.com>
Making changes to textparse lexers
In the rare case that you need to update the textparse lexers, edit promlex.l or openmetricslex.l and then run the following command:
golex -o=promlex.l.go promlex.l
Note that you need golex installed:
go get -u modernc.org/golex