@@ -36,9 +36,11 @@ const (
3636 ProtoType = `application/vnd.google.protobuf`
3737 ProtoProtocol = `io.prometheus.client.MetricFamily`
3838 // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
39- ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";"
40- OpenMetricsType = `application/openmetrics-text`
39+ ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";"
40+ OpenMetricsType = `application/openmetrics-text`
41+ //nolint:revive // Allow for underscores.
4142 OpenMetricsVersion_0_0_1 = "0.0.1"
43+ //nolint:revive // Allow for underscores.
4244 OpenMetricsVersion_1_0_0 = "1.0.0"
4345
4446 // The Content-Type values for the different wire protocols. Do not do direct
@@ -54,8 +56,10 @@ const (
5456 // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
5557 FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text`
5658 // Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
59+ //nolint:revive // Allow for underscores.
5760 FmtOpenMetrics_1_0_0 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_1_0_0 + `; charset=utf-8`
5861 // Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
62+ //nolint:revive // Allow for underscores.
5963 FmtOpenMetrics_0_0_1 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_0_0_1 + `; charset=utf-8`
6064)
6165
@@ -188,8 +192,8 @@ func (f Format) FormatType() FormatType {
188192// Format contains a escaping=allow-utf-8 term, it will select NoEscaping. If a valid
189193// "escaping" term exists, that will be used. Otherwise, the global default will
190194// be returned.
191- func (format Format ) ToEscapingScheme () model.EscapingScheme {
192- for _ , p := range strings .Split (string (format ), ";" ) {
195+ func (f Format ) ToEscapingScheme () model.EscapingScheme {
196+ for _ , p := range strings .Split (string (f ), ";" ) {
193197 toks := strings .Split (p , "=" )
194198 if len (toks ) != 2 {
195199 continue
0 commit comments