diff --git a/pkg/labels/matcher.go b/pkg/labels/matcher.go index 69029f55..3628d43b 100644 --- a/pkg/labels/matcher.go +++ b/pkg/labels/matcher.go @@ -90,7 +90,7 @@ func (m *Matcher) Matches(s string) bool { // openMetricsEscape is similar to the usual string escaping, but more // restricted. It merely replaces a new-line character with '\n', a double-quote -// character with '\"', and a backslack with '\\', which is the escaping used by +// character with '\"', and a backslash with '\\', which is the escaping used by // OpenMetrics. func openMetricsEscape(s string) string { r := strings.NewReplacer( diff --git a/pkg/labels/parse.go b/pkg/labels/parse.go index 3fd213f0..907056fe 100644 --- a/pkg/labels/parse.go +++ b/pkg/labels/parse.go @@ -38,7 +38,7 @@ var ( // ParseMatchers parses a comma-separated list of Matchers. A leading '{' and/or // a trailing '}' is optional and will be trimmed before further // parsing. Individual Matchers are separated by commas outside of quoted parts -// of the input string. Those commas may be sorrounded by whitespace. Parts of the +// of the input string. Those commas may be surrounded by whitespace. Parts of the // string inside unescaped double quotes ('"…"') are considered quoted (and // commas don't act as separators there). If double quotes are escaped with a // single backslash ('\"'), they are ignored for the purpose of identifying @@ -49,10 +49,11 @@ var ( // Examples for valid input strings: // {foo = "bar", dings != "bums", } // foo=bar,dings!=bums +// foo=bar, dings!=bums // {quote="She said: \"Hi, ladies! That's gender-neutral…\""} // statuscode=~"5.." // -// See ParseMatcher for details how an individual Matcher is parsed. +// See ParseMatcher for details on how an individual Matcher is parsed. func ParseMatchers(s string) ([]*Matcher, error) { matchers := []*Matcher{} s = strings.TrimPrefix(s, "{")