make code compatible with go 1.6

This commit is contained in:
Marco Jantke 2017-08-20 00:53:55 +02:00
parent 685a3c90d4
commit 555018f3c9
2 changed files with 31 additions and 41 deletions

View File

@ -78,10 +78,6 @@ func TestCounterVecGetMetricWithInvalidLabelValues(t *testing.T) {
} }
for _, test := range testCases { for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
counterVec := NewCounterVec(CounterOpts{ counterVec := NewCounterVec(CounterOpts{
Name: "test", Name: "test",
}, []string{"a"}) }, []string{"a"})
@ -104,7 +100,6 @@ func TestCounterVecGetMetricWithInvalidLabelValues(t *testing.T) {
if _, err := counterVec.GetMetricWith(test.labels); err == nil { if _, err := counterVec.GetMetricWith(test.labels); err == nil {
t.Errorf("GetMetricWith: expected error because: %s", test.desc) t.Errorf("GetMetricWith: expected error because: %s", test.desc)
} }
})
} }
} }

View File

@ -25,10 +25,6 @@ func TestNewConstMetricInvalidLabelValues(t *testing.T) {
} }
for _, test := range testCases { for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
metricDesc := NewDesc( metricDesc := NewDesc(
"sample_value", "sample_value",
"sample value", "sample value",
@ -43,6 +39,5 @@ func TestNewConstMetricInvalidLabelValues(t *testing.T) {
if _, err := NewConstMetric(metricDesc, CounterValue, 0.3, "\xFF"); err == nil { if _, err := NewConstMetric(metricDesc, CounterValue, 0.3, "\xFF"); err == nil {
t.Errorf("NewConstMetric: expected error because: %s", test.desc) t.Errorf("NewConstMetric: expected error because: %s", test.desc)
} }
})
} }
} }