From 85a216b7fccf8548cf788d2bbca2351c29d05072 Mon Sep 17 00:00:00 2001 From: Markus Rudy Date: Tue, 23 Sep 2025 17:19:10 +0200 Subject: [PATCH] expfmt: document NewTextParser as required Signed-off-by: Markus Rudy --- expfmt/text_parse.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/expfmt/text_parse.go b/expfmt/text_parse.go index 8f2edde32..f3888687c 100644 --- a/expfmt/text_parse.go +++ b/expfmt/text_parse.go @@ -48,8 +48,10 @@ func (e ParseError) Error() string { return fmt.Sprintf("text format parsing error in line %d: %s", e.Line, e.Msg) } -// TextParser is used to parse the simple and flat text-based exchange format. Its -// zero value is ready to use. +// TextParser is used to parse the simple and flat text-based exchange format. +// +// TextParser instances must be created with NewTextParser, the zero value of +// TextParser is invalid. type TextParser struct { metricFamiliesByName map[string]*dto.MetricFamily buf *bufio.Reader // Where the parsed input is read through.