pkg/tsdb/postgres/postgres_test.go: pass context.Background() instead of nil

See,
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline 6m ./...
pkg/tsdb/postgres/postgres_test.go:120:33⚠️ 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/postgres/postgres_test.go:200:33⚠️ 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/postgres/postgres_test.go:257:34⚠️ 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/postgres/postgres_test.go:282:33⚠️ 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/postgres/postgres_test.go:336:33⚠️ 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/postgres/postgres_test.go:363:32⚠️ 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/postgres/postgres_test.go:453:33⚠️ 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/postgres/postgres_test.go:475:33⚠️ 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/postgres/postgres_test.go:497:33⚠️ 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/postgres/postgres_test.go:519:33⚠️ 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/postgres/postgres_test.go:541:33⚠️ 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/postgres/postgres_test.go:563:33⚠️ 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/postgres/postgres_test.go:585:33⚠️ 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/postgres/postgres_test.go:607:33⚠️ 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/postgres/postgres_test.go:629:33⚠️ 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/postgres/postgres_test.go:652:33⚠️ 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/postgres/postgres_test.go:677:33⚠️ 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/postgres/postgres_test.go:738:33⚠️ 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/postgres/postgres_test.go:761:33⚠️ 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/postgres/postgres_test.go:787:33⚠️ 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/postgres/postgres_test.go:817:33⚠️ 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/postgres/postgres_test.go:847:33⚠️ 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/postgres/postgres_test.go:877:33⚠️ 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/postgres/postgres_test.go:905:33⚠️ 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/postgres/postgres_test.go:933:33⚠️ 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)
pull/13506/head
Mario Trangoni 7 years ago
parent 3632e9c756
commit afab9085eb
  1. 51
      pkg/tsdb/postgres/postgres_test.go

@ -1,6 +1,7 @@
package postgres
import (
"context"
"fmt"
"math/rand"
"strings"
@ -117,7 +118,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -197,7 +198,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -254,7 +255,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -279,7 +280,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -333,7 +334,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -360,7 +361,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -450,7 +451,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -472,7 +473,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -494,7 +495,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -516,7 +517,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -538,7 +539,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -560,7 +561,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -582,7 +583,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -604,7 +605,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -626,7 +627,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -649,7 +650,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -674,7 +675,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -735,7 +736,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
queryResult := resp.Results["Deploys"]
So(err, ShouldBeNil)
So(len(queryResult.Tables[0].Rows), ShouldEqual, 3)
@ -758,7 +759,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
queryResult := resp.Results["Tickets"]
So(err, ShouldBeNil)
So(len(queryResult.Tables[0].Rows), ShouldEqual, 3)
@ -784,7 +785,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -814,7 +815,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -844,7 +845,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -874,7 +875,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -902,7 +903,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
@ -930,7 +931,7 @@ func TestPostgres(t *testing.T) {
},
}
resp, err := endpoint.Query(nil, nil, query)
resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)

Loading…
Cancel
Save