Commit 88efb87b by Mario Trangoni

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:warning: 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:warning: 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:warning: 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:warning: 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:warning: 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:warning: 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)
parent d1e1fb7e
...@@ -25,7 +25,7 @@ func TestClient(t *testing.T) { ...@@ -25,7 +25,7 @@ func TestClient(t *testing.T) {
JsonData: simplejson.NewFromAny(make(map[string]interface{})), JsonData: simplejson.NewFromAny(make(map[string]interface{})),
} }
_, err := NewClient(nil, ds, nil) _, err := NewClient(context.Background(), ds, nil)
So(err, ShouldNotBeNil) So(err, ShouldNotBeNil)
}) })
...@@ -36,7 +36,7 @@ func TestClient(t *testing.T) { ...@@ -36,7 +36,7 @@ func TestClient(t *testing.T) {
}), }),
} }
_, err := NewClient(nil, ds, nil) _, err := NewClient(context.Background(), ds, nil)
So(err, ShouldNotBeNil) So(err, ShouldNotBeNil)
}) })
...@@ -48,7 +48,7 @@ func TestClient(t *testing.T) { ...@@ -48,7 +48,7 @@ func TestClient(t *testing.T) {
}), }),
} }
_, err := NewClient(nil, ds, nil) _, err := NewClient(context.Background(), ds, nil)
So(err, ShouldNotBeNil) So(err, ShouldNotBeNil)
}) })
...@@ -60,7 +60,7 @@ func TestClient(t *testing.T) { ...@@ -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(err, ShouldBeNil)
So(c.GetVersion(), ShouldEqual, 2) So(c.GetVersion(), ShouldEqual, 2)
}) })
...@@ -73,7 +73,7 @@ func TestClient(t *testing.T) { ...@@ -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(err, ShouldBeNil)
So(c.GetVersion(), ShouldEqual, 5) So(c.GetVersion(), ShouldEqual, 5)
}) })
...@@ -86,7 +86,7 @@ func TestClient(t *testing.T) { ...@@ -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(err, ShouldBeNil)
So(c.GetVersion(), ShouldEqual, 56) So(c.GetVersion(), ShouldEqual, 56)
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment