lib/storage: pass pointer to MetricName in Fatalf, so it is properly detected as an interface with String() method

This fixes lint errors
This commit is contained in:
Aliaksandr Valialkin 2019-11-04 01:06:34 +02:00
parent e05500cbd4
commit 2a38d30f93

View file

@ -164,7 +164,7 @@ func TestMetricNameCopyFrom(t *testing.T) {
expected.AddTag("key", "value")
if !reflect.DeepEqual(expected, to) {
t.Fatalf("expecting equal metics exp: %s, got %s", expected, to)
t.Fatalf("expecting equal metics exp: %s, got %s", &expected, &to)
}
}
@ -174,7 +174,7 @@ func TestMetricNameRemoveTagsOn(t *testing.T) {
emptyMN.AddTag("key", "value")
emptyMN.RemoveTagsOn(nil)
if len(emptyMN.MetricGroup) != 0 || len(emptyMN.Tags) != 0 {
t.Fatalf("expecitng empty metric name got %s", emptyMN)
t.Fatalf("expecitng empty metric name got %s", &emptyMN)
}
var asIsMN MetricName
@ -185,7 +185,7 @@ func TestMetricNameRemoveTagsOn(t *testing.T) {
expAsIsMN.MetricGroup = []byte("name")
expAsIsMN.AddTag("key", "value")
if !reflect.DeepEqual(expAsIsMN, asIsMN) {
t.Fatalf("expecitng %s got %s", expAsIsMN, asIsMN)
t.Fatalf("expecitng %s got %s", &expAsIsMN, &asIsMN)
}
var mn MetricName
@ -196,7 +196,7 @@ func TestMetricNameRemoveTagsOn(t *testing.T) {
var expMN MetricName
expMN.AddTag("baz", "qux")
if !reflect.DeepEqual(expMN.Tags, mn.Tags) || len(mn.MetricGroup) != len(expMN.MetricGroup) {
t.Fatalf("expecitng %s got %s", expMN, mn)
t.Fatalf("expecitng %s got %s", &expMN, &mn)
}
}
@ -207,13 +207,13 @@ func TestMetricNameRemoveTag(t *testing.T) {
mn.AddTag("baz", "qux")
mn.RemoveTag("__name__")
if len(mn.MetricGroup) != 0 {
t.Fatalf("expecting empty metric group got %s", mn)
t.Fatalf("expecting empty metric group got %s", &mn)
}
mn.RemoveTag("foo")
var expMN MetricName
expMN.AddTag("baz", "qux")
if !reflect.DeepEqual(expMN.Tags, mn.Tags) || len(mn.MetricGroup) != len(expMN.MetricGroup) {
t.Fatalf("expecitng %s got %s", expMN, mn)
t.Fatalf("expecitng %s got %s", &expMN, &mn)
}
}
@ -226,6 +226,6 @@ func TestMetricNameRemoveTagsIgnoring(t *testing.T) {
var expMN MetricName
expMN.AddTag("baz", "qux")
if !reflect.DeepEqual(expMN.Tags, mn.Tags) || len(mn.MetricGroup) != len(expMN.MetricGroup) {
t.Fatalf("expecitng %s got %s", expMN, mn)
t.Fatalf("expecitng %s got %s", &expMN, &mn)
}
}