1 package lv 2 3 // LabelValues is a type alias that provides validation on its With method. 4 // Metrics may include it as a member to help them satisfy With semantics and 5 // save some code duplication. 6 type LabelValues []string 7 8 // With validates the input, and returns a new aggregate labelValues. 9 func (lvs LabelValues) With(labelValues ...string) LabelValues { 10 if len(labelValues)%2 != 0 { 11 labelValues = append(labelValues, "unknown") 12 } 13 return append(lvs, labelValues...) 14 } 15