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

@@ -18,6 +18,7 @@ package cmd
import (
"bytes"
"context"
"encoding/base64"
"fmt"
"io/ioutil"
@@ -138,7 +139,7 @@ func testPostPolicyBucketHandler(obj ObjectLayer, instanceType string, t TestErr
// objectNames[0].
// uploadIds [0].
// Create bucket before initiating NewMultipartUpload.
err = obj.MakeBucketWithLocation(nil, bucketName, "")
err = obj.MakeBucketWithLocation(context.Background(), bucketName, "")
if err != nil {
// Failed to create newbucket, abort.
t.Fatalf("%s : %s", instanceType, err.Error())
@@ -229,7 +230,7 @@ func testPostPolicyBucketHandler(obj ObjectLayer, instanceType string, t TestErr
}
// When the operation is successful, check if sending metadata is successful too
if rec.Code == http.StatusNoContent {
objInfo, err := obj.GetObjectInfo(nil, bucketName, testCase.objectName+"/upload.txt")
objInfo, err := obj.GetObjectInfo(context.Background(), bucketName, testCase.objectName+"/upload.txt")
if err != nil {
t.Error("Unexpected error: ", err)
}
@@ -448,7 +449,7 @@ func testPostPolicyBucketHandlerRedirect(obj ObjectLayer, instanceType string, t
curTime := UTCNow()
curTimePlus5Min := curTime.Add(time.Minute * 5)
err = obj.MakeBucketWithLocation(nil, bucketName, "")
err = obj.MakeBucketWithLocation(context.Background(), bucketName, "")
if err != nil {
// Failed to create newbucket, abort.
t.Fatalf("%s : %s", instanceType, err.Error())
@@ -482,7 +483,7 @@ func testPostPolicyBucketHandlerRedirect(obj ObjectLayer, instanceType string, t
}
// Get the uploaded object info
info, err := obj.GetObjectInfo(nil, bucketName, targetObj)
info, err := obj.GetObjectInfo(context.Background(), bucketName, targetObj)
if err != nil {
t.Error("Unexpected error: ", err)
}