mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
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:
parent
e05500cbd4
commit
2a38d30f93
1 changed files with 7 additions and 7 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue