OSDN Git Service

8bb1ba0941487e6eabbcaf046dd4f8ba9f05d721
[bytom/vapor.git] / vendor / github.com / go-kit / kit / metrics / internal / lv / labelvalues.go
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 }