pkg/tsdb/elasticsearch/client/client_test.go: pass context.Background() instead of nil

See,
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline 6m ./...
pkg/tsdb/elasticsearch/client/client_test.go:28:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:39:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:51:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:63:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:76:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:89:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
This commit is contained in:
Mario Trangoni
2018-10-03 09:57:59 +02:00
parent d1e1fb7e72
commit 88efb87b0d

View File

@@ -25,7 +25,7 @@ func TestClient(t *testing.T) {
JsonData: simplejson.NewFromAny(make(map[string]interface{})),
}
_, err := NewClient(nil, ds, nil)
_, err := NewClient(context.Background(), ds, nil)
So(err, ShouldNotBeNil)
})
@@ -36,7 +36,7 @@ func TestClient(t *testing.T) {
}),
}
_, err := NewClient(nil, ds, nil)
_, err := NewClient(context.Background(), ds, nil)
So(err, ShouldNotBeNil)
})
@@ -48,7 +48,7 @@ func TestClient(t *testing.T) {
}),
}
_, err := NewClient(nil, ds, nil)
_, err := NewClient(context.Background(), ds, nil)
So(err, ShouldNotBeNil)
})
@@ -60,7 +60,7 @@ func TestClient(t *testing.T) {
}),
}
c, err := NewClient(nil, ds, nil)
c, err := NewClient(context.Background(), ds, nil)
So(err, ShouldBeNil)
So(c.GetVersion(), ShouldEqual, 2)
})
@@ -73,7 +73,7 @@ func TestClient(t *testing.T) {
}),
}
c, err := NewClient(nil, ds, nil)
c, err := NewClient(context.Background(), ds, nil)
So(err, ShouldBeNil)
So(c.GetVersion(), ShouldEqual, 5)
})
@@ -86,7 +86,7 @@ func TestClient(t *testing.T) {
}),
}
c, err := NewClient(nil, ds, nil)
c, err := NewClient(context.Background(), ds, nil)
So(err, ShouldBeNil)
So(c.GetVersion(), ShouldEqual, 56)
})