Use context.Background() instead of nil

Rename Context[Get|Set] -> [Get|Set]Context
This commit is contained in:
Krishna Srinivas
2018-03-15 13:27:16 -07:00
committed by kannappanr
parent 33fe42df8a
commit 9ede179a21
45 changed files with 431 additions and 468 deletions

View File

@@ -19,6 +19,7 @@ package cmd
import (
"bufio"
"bytes"
"context"
"crypto/ecdsa"
"crypto/hmac"
crand "crypto/rand"
@@ -1766,7 +1767,7 @@ func initAPIHandlerTest(obj ObjectLayer, endpoints []string) (string, http.Handl
bucketName := getRandomBucketName()
// Create bucket.
err := obj.MakeBucketWithLocation(nil, bucketName, "")
err := obj.MakeBucketWithLocation(context.Background(), bucketName, "")
if err != nil {
// failed to create newbucket, return err.
return "", nil, err
@@ -1872,7 +1873,7 @@ func ExecObjectLayerAPIAnonTest(t *testing.T, obj ObjectLayer, testName, bucketN
Version: "1.0",
Statements: []policy.Statement{policyFunc(bucketName, "")},
}
obj.SetBucketPolicy(nil, bucketName, bp)
obj.SetBucketPolicy(context.Background(), bucketName, bp)
// now call the handler again with the unsigned/anonymous request, it should be accepted.
rec = httptest.NewRecorder()