Repository: minio/minio-go
Pull request #1477 (2021-04-13 09:06:05)

Mint - Add test to check ListObjectsV2MHandler with metadata
## Description
Add test to check ListObjects with metadata.

## Motivation and Context
- Improvement of the overall test coverage

## How to test this PR?
- Run the Mint tests with coverage and consult the coverage report.
See https://github.com/minio/minio/pull/11783 for a detailed description how to run the Mint tests with code coverage.
 

## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Optimization (provides speedup with no functional changes)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)


## Checklist:
- [ ] Fixes a regression (If yes, please add `commit-id` or `PR #` here)
- [ ] Documentation updated
- [ ] Unit tests added/updated


Patch:
diff --git a/.github/workflows/go-windows.yml b/.github/workflows/go-windows.yml
index 093e524..535a6f4 100644
--- a/.github/workflows/go-windows.yml
+++ b/.github/workflows/go-windows.yml
@@ -14,7 +14,7 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        go-version: [1.14.x, 1.15.x]
+        go-version: [1.14.x, 1.15.x, 1.16.x]
         os: [windows-latest]
     steps:
       - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 8a3d070..276a575 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -14,7 +14,7 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        go-version: [1.14.x, 1.15.x]
+        go-version: [1.14.x, 1.15.x, 1.16.x]
         os: [ubuntu-latest]
     steps:
       - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
diff --git a/Makefile b/Makefile
index a6f0b9b..ae640c4 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,10 @@ test:
 	@GO111MODULE=on SERVER_ENDPOINT=localhost:9000 ACCESS_KEY=minio SECRET_KEY=minio123 ENABLE_HTTPS=1 MINT_MODE=full go test -race -v ./...
 
 examples:
-	@$(foreach v,$(wildcard examples/s3/*), go build -o ${TMPDIR}/$(basename $(v)) $(v) || exit 1;)
+	@echo "Building s3 examples"
+	@cd ./examples/s3 && $(foreach v,$(wildcard examples/s3/*.go),go build -mod=mod -o ${TMPDIR}/$(basename $(v)) $(notdir $(v)) || exit 1;)
+	@echo "Building minio examples"
+	@cd ./examples/minio && $(foreach v,$(wildcard examples/minio/*.go),go build -mod=mod -o ${TMPDIR}/$(basename $(v)) $(notdir $(v)) || exit 1;)
 
 functional-test:
 	@GO111MODULE=on SERVER_ENDPOINT=localhost:9000 ACCESS_KEY=minio SECRET_KEY=minio123 ENABLE_HTTPS=1 MINT_MODE=full go run functional_tests.go
diff --git a/README.md b/README.md
index ab5bcb5..b5c26d5 100644
--- a/README.md
+++ b/README.md
@@ -104,12 +104,12 @@ func main() {
 	contentType := "application/zip"
 
 	// Upload the zip file with FPutObject
-	n, err := minioClient.FPutObject(ctx, bucketName, objectName, filePath, minio.PutObjectOptions{ContentType: contentType})
+	info, err := minioClient.FPutObject(ctx, bucketName, objectName, filePath, minio.PutObjectOptions{ContentType: contentType})
 	if err != nil {
 		log.Fatalln(err)
 	}
 
-	log.Printf("Successfully uploaded %s of size %d\n", objectName, n)
+	log.Printf("Successfully uploaded %s of size %d\n", objectName, info.Size)
 }
 ```
 
diff --git a/api-bucket-policy.go b/api-bucket-policy.go
index 72676f3..7e01275 100644
--- a/api-bucket-policy.go
+++ b/api-bucket-policy.go
@@ -63,7 +63,7 @@ func (c Client) putBucketPolicy(ctx context.Context, bucketName, policy string)
 		return err
 	}
 	if resp != nil {
-		if resp.StatusCode != http.StatusNoContent {
+		if resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusOK {
 			return httpRespToErrorResponse(resp, bucketName, "")
 		}
 	}
diff --git a/api-bucket-replication.go b/api-bucket-replication.go
index ef10355..41054e1 100644
--- a/api-bucket-replication.go
+++ b/api-bucket-replication.go
@@ -25,6 +25,7 @@ import (
 	"io/ioutil"
 	"net/http"
 	"net/url"
+	"time"
 
 	"github.com/minio/minio-go/v7/pkg/replication"
 	"github.com/minio/minio-go/v7/pkg/s3utils"
@@ -185,3 +186,43 @@ func (c Client) GetBucketReplicationMetrics(ctx context.Context, bucketName stri
 	}
 	return s, nil
 }
+
+// ResetBucketReplication kicks off replication of previously replicated objects if ExistingObjectReplication
+// is enabled in the replication config
+func (c Client) ResetBucketReplication(ctx context.Context, bucketName string, olderThan time.Duration) (resetID string, err error) {
+	// Input validation.
+	if err := s3utils.CheckValidBucketName(bucketName); err != nil {
+		return "", err
+	}
+	// Get resources properly escaped and lined up before
+	// using them in http request.
+	urlValues := make(url.Values)
+	urlValues.Set("replication-reset", "")
+	if olderThan > 0 {
+		urlValues.Set("older-than", olderThan.String())
+	}
+
+	// Execute GET on bucket to get replication config.
+	resp, err := c.executeMethod(ctx, http.MethodPut, requestMetadata{
+		bucketName:  bucketName,
+		queryValues: urlValues,
+	})
+
+	defer closeResponse(resp)
+	if err != nil {
+		return "", err
+	}
+
+	if resp.StatusCode != http.StatusOK {
+		return "", httpRespToErrorResponse(resp, bucketName, "")
+	}
+	respBytes, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		return "", err
+	}
+
+	if err := json.Unmarshal(respBytes, &resetID); err != nil {
+		return "", err
+	}
+	return resetID, nil
+}
diff --git a/api-put-object-multipart.go b/api-put-object-multipart.go
index 222fd52..a70d705 100644
--- a/api-put-object-multipart.go
+++ b/api-put-object-multipart.go
@@ -32,6 +32,7 @@ import (
 	"strconv"
 	"strings"
 
+	"github.com/google/uuid"
 	"github.com/minio/minio-go/v7/pkg/encrypt"
 	"github.com/minio/minio-go/v7/pkg/s3utils"
 )
@@ -198,6 +199,13 @@ func (c Client) initiateMultipartUpload(ctx context.Context, bucketName, objectN
 	urlValues := make(url.Values)
 	urlValues.Set("uploads", "")
 
+	if opts.Internal.SourceVersionID != "" {
+		if _, err := uuid.Parse(opts.Internal.SourceVersionID); err != nil {
+			return initiateMultipartUploadResult{}, errInvalidArgument(err.Error())
+		}
+		urlValues.Set("versionId", opts.Internal.SourceVersionID)
+	}
+
 	// Set ContentType header.
 	customHeader := opts.Header()
 
diff --git a/api.go b/api.go
index 2c2b77d..44660ab 100644
--- a/api.go
+++ b/api.go
@@ -544,9 +544,6 @@ func (c Client) executeMethod(ctx context.Context, method string, metadata reque
 	// Indicate to our routine to exit cleanly upon return.
 	defer cancel()
 
-	// Blank indentifier is kept here on purpose since 'range' without
-	// blank identifiers is only supported since go1.4
-	// https://golang.org/doc/go1.4#forrange.
 	for range c.newRetryTimer(retryCtx, reqRetry, DefaultRetryUnit, DefaultRetryCap, MaxJitter) {
 		// Retry executes the following function body if request has an
 		// error until maxRetries have been exhausted, retry attempts are
diff --git a/docs/API.md b/docs/API.md
index 47be8fd..0177a00 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -42,7 +42,7 @@ import (
     "fmt"
 
     "github.com/minio/minio-go/v7"
-    "github.com/minio/minio-go/v7/credentials"
+    "github.com/minio/minio-go/v7/pkg/credentials"
 )
 
 func main() {
diff --git a/examples/minio/getbucketreplicationmetrics.go b/examples/minio/getbucketreplicationmetrics.go
index b49d8be..6b50f1b 100644
--- a/examples/minio/getbucketreplicationmetrics.go
+++ b/examples/minio/getbucketreplicationmetrics.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/minio/go.mod b/examples/minio/go.mod
new file mode 100644
index 0000000..b38a677
--- /dev/null
+++ b/examples/minio/go.mod
@@ -0,0 +1,9 @@
+module github.com/minio/minio-go/examples/minio
+
+go 1.14
+
+require github.com/minio/minio-go/v7 v7.0.10
+
+replace (
+	github.com/minio/minio-go/v7 v7.0.10 => ../..
+)
\ No newline at end of file
diff --git a/examples/minio/go.sum b/examples/minio/go.sum
new file mode 100644
index 0000000..84a9e57
--- /dev/null
+++ b/examples/minio/go.sum
@@ -0,0 +1,74 @@
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
+github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
+github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
+github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
+github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
+github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
+github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s=
+github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4=
+github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
+github.com/minio/minio-go/v7 v7.0.10 h1:1oUKe4EOPUEhw2qnPQaPsJ0lmVTYLFu03SiItauXs94=
+github.com/minio/minio-go/v7 v7.0.10/go.mod h1:td4gW1ldOsj1PbSNS+WYK43j+P1XVhX/8W8awaYlBFo=
+github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=
+github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
+github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
+github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
+github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=
+github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
+github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
+github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
+github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg=
+golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=
+golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
+golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww=
+gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/examples/minio/listen-notification.go b/examples/minio/listen-notification.go
index 6a9c54e..260ac47 100644
--- a/examples/minio/listen-notification.go
+++ b/examples/minio/listen-notification.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/minio/listenbucketnotification.go b/examples/minio/listenbucketnotification.go
index 92b5c67..a4b95f8 100644
--- a/examples/minio/listenbucketnotification.go
+++ b/examples/minio/listenbucketnotification.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/bucketexists.go b/examples/s3/bucketexists.go
index eafbb55..1ab3a8b 100644
--- a/examples/s3/bucketexists.go
+++ b/examples/s3/bucketexists.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/composeobject.go b/examples/s3/composeobject.go
index b84e097..af9b2b3 100644
--- a/examples/s3/composeobject.go
+++ b/examples/s3/composeobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/copyobject-with-new-tags.go b/examples/s3/copyobject-with-new-tags.go
index 60c2ac0..297afa5 100644
--- a/examples/s3/copyobject-with-new-tags.go
+++ b/examples/s3/copyobject-with-new-tags.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/copyobject.go b/examples/s3/copyobject.go
index cd7b7d8..73e38b3 100644
--- a/examples/s3/copyobject.go
+++ b/examples/s3/copyobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/enableversioning.go b/examples/s3/enableversioning.go
index 6876d44..e89cb22 100644
--- a/examples/s3/enableversioning.go
+++ b/examples/s3/enableversioning.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/fgetobject.go b/examples/s3/fgetobject.go
index cbd17f7..31541e7 100644
--- a/examples/s3/fgetobject.go
+++ b/examples/s3/fgetobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/fputencrypted-object.go b/examples/s3/fputencrypted-object.go
index 9bea037..62a441c 100644
--- a/examples/s3/fputencrypted-object.go
+++ b/examples/s3/fputencrypted-object.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/fputobject.go b/examples/s3/fputobject.go
index bb4ffc8..68ba5ff 100644
--- a/examples/s3/fputobject.go
+++ b/examples/s3/fputobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/get-encrypted-object.go b/examples/s3/get-encrypted-object.go
index fdfe552..e558efc 100644
--- a/examples/s3/get-encrypted-object.go
+++ b/examples/s3/get-encrypted-object.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getbucketencryption.go b/examples/s3/getbucketencryption.go
index 0d84f38..4c1f687 100644
--- a/examples/s3/getbucketencryption.go
+++ b/examples/s3/getbucketencryption.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getbucketlifecycle.go b/examples/s3/getbucketlifecycle.go
index de5e535..c98e403 100644
--- a/examples/s3/getbucketlifecycle.go
+++ b/examples/s3/getbucketlifecycle.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getbucketnotification.go b/examples/s3/getbucketnotification.go
index efafac8..e756bdc 100644
--- a/examples/s3/getbucketnotification.go
+++ b/examples/s3/getbucketnotification.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getbucketpolicy.go b/examples/s3/getbucketpolicy.go
index 1cf2e24..3345cca 100644
--- a/examples/s3/getbucketpolicy.go
+++ b/examples/s3/getbucketpolicy.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getbucketreplication.go b/examples/s3/getbucketreplication.go
index aed1744..59b35cb 100644
--- a/examples/s3/getbucketreplication.go
+++ b/examples/s3/getbucketreplication.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getbuckettagging.go b/examples/s3/getbuckettagging.go
index 9d2067e..f5aec9b 100644
--- a/examples/s3/getbuckettagging.go
+++ b/examples/s3/getbuckettagging.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getbucketversioning.go b/examples/s3/getbucketversioning.go
index 9b55d89..5fbe2da 100644
--- a/examples/s3/getbucketversioning.go
+++ b/examples/s3/getbucketversioning.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getobject-client-encryption.go b/examples/s3/getobject-client-encryption.go
index 7d75baa..871cda3 100644
--- a/examples/s3/getobject-client-encryption.go
+++ b/examples/s3/getobject-client-encryption.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getobject.go b/examples/s3/getobject.go
index 7fec93f..133c90a 100644
--- a/examples/s3/getobject.go
+++ b/examples/s3/getobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getobjectacl.go b/examples/s3/getobjectacl.go
index 0581ce1..6ddee39 100644
--- a/examples/s3/getobjectacl.go
+++ b/examples/s3/getobjectacl.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getobjectlegalhold.go b/examples/s3/getobjectlegalhold.go
index 018b96f..6ab2fe0 100644
--- a/examples/s3/getobjectlegalhold.go
+++ b/examples/s3/getobjectlegalhold.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getobjectlockconfig.go b/examples/s3/getobjectlockconfig.go
index f00ec0e..17569b7 100644
--- a/examples/s3/getobjectlockconfig.go
+++ b/examples/s3/getobjectlockconfig.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getobjectretention.go b/examples/s3/getobjectretention.go
index 8f19c71..aabfb05 100644
--- a/examples/s3/getobjectretention.go
+++ b/examples/s3/getobjectretention.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/getobjecttagging.go b/examples/s3/getobjecttagging.go
index 0132536..81ab377 100644
--- a/examples/s3/getobjecttagging.go
+++ b/examples/s3/getobjecttagging.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/go.mod b/examples/s3/go.mod
new file mode 100644
index 0000000..ef3db2c
--- /dev/null
+++ b/examples/s3/go.mod
@@ -0,0 +1,12 @@
+module github.com/minio/minio-go/examples/s3
+
+go 1.14
+
+require (
+	github.com/cheggaaa/pb v1.0.29
+	github.com/minio/minio-go/v7 v7.0.10
+	github.com/minio/sio v0.3.0
+	golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
+)
+
+replace github.com/minio/minio-go/v7 v7.0.10 => ../..
diff --git a/examples/s3/go.sum b/examples/s3/go.sum
new file mode 100644
index 0000000..3ae798c
--- /dev/null
+++ b/examples/s3/go.sum
@@ -0,0 +1,95 @@
+github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo=
+github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
+github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
+github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
+github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
+github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
+github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
+github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
+github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
+github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s=
+github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
+github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
+github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
+github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
+github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
+github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
+github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
+github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4=
+github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
+github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=
+github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
+github.com/minio/sio v0.3.0 h1:syEFBewzOMOYVzSTFpp1MqpSZk8rUNbz8VIIc+PNzus=
+github.com/minio/sio v0.3.0/go.mod h1:8b0yPp2avGThviy/+OCJBI6OMpvxoUuiLvE6F1lebhw=
+github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
+github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
+github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=
+github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
+github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
+github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
+github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
+github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
+golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww=
+gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/examples/s3/listbuckets.go b/examples/s3/listbuckets.go
index 3483662..d1ac603 100644
--- a/examples/s3/listbuckets.go
+++ b/examples/s3/listbuckets.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/listincompleteuploads.go b/examples/s3/listincompleteuploads.go
index adcc105..edb1c2f 100644
--- a/examples/s3/listincompleteuploads.go
+++ b/examples/s3/listincompleteuploads.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/listobjects-N.go b/examples/s3/listobjects-N.go
index c42a418..e534b78 100644
--- a/examples/s3/listobjects-N.go
+++ b/examples/s3/listobjects-N.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/listobjects.go b/examples/s3/listobjects.go
index 203f8e0..9f07bd6 100644
--- a/examples/s3/listobjects.go
+++ b/examples/s3/listobjects.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/listobjectsV2.go b/examples/s3/listobjectsV2.go
index b93424b..f904619 100644
--- a/examples/s3/listobjectsV2.go
+++ b/examples/s3/listobjectsV2.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/listobjectsV2WithMetadata.go b/examples/s3/listobjectsV2WithMetadata.go
index e822c4a..119e9d8 100644
--- a/examples/s3/listobjectsV2WithMetadata.go
+++ b/examples/s3/listobjectsV2WithMetadata.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/listobjectversions.go b/examples/s3/listobjectversions.go
index 6e83576..b14aa76 100644
--- a/examples/s3/listobjectversions.go
+++ b/examples/s3/listobjectversions.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/makebucket.go b/examples/s3/makebucket.go
index 82282c1..218e9df 100644
--- a/examples/s3/makebucket.go
+++ b/examples/s3/makebucket.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/presignedgetobject.go b/examples/s3/presignedgetobject.go
index 731727f..ef5a908 100644
--- a/examples/s3/presignedgetobject.go
+++ b/examples/s3/presignedgetobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/presignedheadobject.go b/examples/s3/presignedheadobject.go
index 2d9afcc..3c59cd5 100644
--- a/examples/s3/presignedheadobject.go
+++ b/examples/s3/presignedheadobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/presignedpostpolicy.go b/examples/s3/presignedpostpolicy.go
index e5fe152..3c9c51d 100644
--- a/examples/s3/presignedpostpolicy.go
+++ b/examples/s3/presignedpostpolicy.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/presignedputobject.go b/examples/s3/presignedputobject.go
index fed3ce4..fc29c8a 100644
--- a/examples/s3/presignedputobject.go
+++ b/examples/s3/presignedputobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/put-encrypted-object.go b/examples/s3/put-encrypted-object.go
index e0c42f6..aa18bf7 100644
--- a/examples/s3/put-encrypted-object.go
+++ b/examples/s3/put-encrypted-object.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobject-client-encryption.go b/examples/s3/putobject-client-encryption.go
index 04d6055..ecdcd07 100644
--- a/examples/s3/putobject-client-encryption.go
+++ b/examples/s3/putobject-client-encryption.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobject-getobject-sse.go b/examples/s3/putobject-getobject-sse.go
index 2764a20..4df33ac 100644
--- a/examples/s3/putobject-getobject-sse.go
+++ b/examples/s3/putobject-getobject-sse.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobject-progress.go b/examples/s3/putobject-progress.go
index 82b3228..fa2cd76 100644
--- a/examples/s3/putobject-progress.go
+++ b/examples/s3/putobject-progress.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobject-s3-accelerate.go b/examples/s3/putobject-s3-accelerate.go
index f795642..6d51d96 100644
--- a/examples/s3/putobject-s3-accelerate.go
+++ b/examples/s3/putobject-s3-accelerate.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobject-streaming.go b/examples/s3/putobject-streaming.go
index 3ccdbca..4e79b71 100644
--- a/examples/s3/putobject-streaming.go
+++ b/examples/s3/putobject-streaming.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobject-with-tags.go b/examples/s3/putobject-with-tags.go
index 4b8b9b9..d39e9a9 100644
--- a/examples/s3/putobject-with-tags.go
+++ b/examples/s3/putobject-with-tags.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobject.go b/examples/s3/putobject.go
index 7f6071a..7f94e86 100644
--- a/examples/s3/putobject.go
+++ b/examples/s3/putobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobjectlegalhold.go b/examples/s3/putobjectlegalhold.go
index 453628a..828bad3 100644
--- a/examples/s3/putobjectlegalhold.go
+++ b/examples/s3/putobjectlegalhold.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobjectretention.go b/examples/s3/putobjectretention.go
index a519f44..7a62ad0 100644
--- a/examples/s3/putobjectretention.go
+++ b/examples/s3/putobjectretention.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/putobjecttagging.go b/examples/s3/putobjecttagging.go
index 45084cc..806a25c 100644
--- a/examples/s3/putobjecttagging.go
+++ b/examples/s3/putobjecttagging.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/removeallbucketnotification.go b/examples/s3/removeallbucketnotification.go
index c6caa67..af83998 100644
--- a/examples/s3/removeallbucketnotification.go
+++ b/examples/s3/removeallbucketnotification.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/removebucket.go b/examples/s3/removebucket.go
index 581776c..02f3af1 100644
--- a/examples/s3/removebucket.go
+++ b/examples/s3/removebucket.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/removebucketencryption.go b/examples/s3/removebucketencryption.go
index b06a937..e0eafe1 100644
--- a/examples/s3/removebucketencryption.go
+++ b/examples/s3/removebucketencryption.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/removebucketreplication.go b/examples/s3/removebucketreplication.go
index 32d4905..3e0b3c4 100644
--- a/examples/s3/removebucketreplication.go
+++ b/examples/s3/removebucketreplication.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/removebuckettagging.go b/examples/s3/removebuckettagging.go
index 99a8e5d..713dcce 100644
--- a/examples/s3/removebuckettagging.go
+++ b/examples/s3/removebuckettagging.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/removeincompleteupload.go b/examples/s3/removeincompleteupload.go
index cf16e0e..02c785d 100644
--- a/examples/s3/removeincompleteupload.go
+++ b/examples/s3/removeincompleteupload.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/removeobject.go b/examples/s3/removeobject.go
index 777835d..ae8c42c 100644
--- a/examples/s3/removeobject.go
+++ b/examples/s3/removeobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/removeobjects.go b/examples/s3/removeobjects.go
index 94d31ca..26ce978 100644
--- a/examples/s3/removeobjects.go
+++ b/examples/s3/removeobjects.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/removeobjecttagging.go b/examples/s3/removeobjecttagging.go
index d5d3358..bd0b291 100644
--- a/examples/s3/removeobjecttagging.go
+++ b/examples/s3/removeobjecttagging.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/selectobject.go b/examples/s3/selectobject.go
index ea06aff..37106e0 100644
--- a/examples/s3/selectobject.go
+++ b/examples/s3/selectobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/setbucketencryption.go b/examples/s3/setbucketencryption.go
index 81e3c05..9732744 100644
--- a/examples/s3/setbucketencryption.go
+++ b/examples/s3/setbucketencryption.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/setbucketlifecycle.go b/examples/s3/setbucketlifecycle.go
index f829f8e..0284b9e 100644
--- a/examples/s3/setbucketlifecycle.go
+++ b/examples/s3/setbucketlifecycle.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/setbucketnotification.go b/examples/s3/setbucketnotification.go
index 213b669..9b83b44 100644
--- a/examples/s3/setbucketnotification.go
+++ b/examples/s3/setbucketnotification.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/setbucketpolicy.go b/examples/s3/setbucketpolicy.go
index 9e47b29..964efe5 100644
--- a/examples/s3/setbucketpolicy.go
+++ b/examples/s3/setbucketpolicy.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/setbucketreplication.go b/examples/s3/setbucketreplication.go
index 173e619..1569336 100644
--- a/examples/s3/setbucketreplication.go
+++ b/examples/s3/setbucketreplication.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/setbuckettagging.go b/examples/s3/setbuckettagging.go
index 09f579d..7fb4817 100644
--- a/examples/s3/setbuckettagging.go
+++ b/examples/s3/setbuckettagging.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/setobjectlockconfig.go b/examples/s3/setobjectlockconfig.go
index 653c838..08fc927 100644
--- a/examples/s3/setobjectlockconfig.go
+++ b/examples/s3/setobjectlockconfig.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/statobject.go b/examples/s3/statobject.go
index 667b9e4..253c3a2 100644
--- a/examples/s3/statobject.go
+++ b/examples/s3/statobject.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/examples/s3/suspendversioning.go b/examples/s3/suspendversioning.go
index b7f8d6a..b0d0bcf 100644
--- a/examples/s3/suspendversioning.go
+++ b/examples/s3/suspendversioning.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build example
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
diff --git a/go.mod b/go.mod
index 34ae106..5468818 100644
--- a/go.mod
+++ b/go.mod
@@ -1,22 +1,20 @@
 module github.com/minio/minio-go/v7
 
-go 1.12
+go 1.14
 
 require (
-	github.com/cheggaaa/pb v1.0.29 // indirect
-	github.com/dustin/go-humanize v1.0.0 // indirect
+	github.com/dustin/go-humanize v1.0.0
 	github.com/google/uuid v1.1.1
 	github.com/json-iterator/go v1.1.10
 	github.com/klauspost/cpuid v1.3.1 // indirect
 	github.com/kr/pretty v0.1.0 // indirect
 	github.com/minio/md5-simd v1.1.0
 	github.com/minio/sha256-simd v0.1.1
-	github.com/minio/sio v0.2.1 // indirect
 	github.com/mitchellh/go-homedir v1.1.0
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.1 // indirect
 	github.com/rs/xid v1.2.1
-	github.com/sirupsen/logrus v1.8.0 // indirect
+	github.com/sirupsen/logrus v1.8.1
 	github.com/smartystreets/goconvey v1.6.4 // indirect
 	github.com/stretchr/testify v1.4.0 // indirect
 	golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
diff --git a/go.sum b/go.sum
index b765d00..1ba98c4 100644
--- a/go.sum
+++ b/go.sum
@@ -1,11 +1,8 @@
-github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo=
-github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
 github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
-github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
 github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -15,7 +12,6 @@ github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr
 github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
-github.com/klauspost/cpuid v1.2.3 h1:CCtW0xUnWGVINKvE/WWOYKdsPV6mawAtvQuSl8guwQs=
 github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
 github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s=
 github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4=
@@ -24,25 +20,15 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
-github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
-github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
-github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
-github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
-github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
 github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4=
 github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
 github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=
 github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
-github.com/minio/sio v0.2.1 h1:NjzKiIMSMcHediVQR0AFVx2tp7Wxh9tKPfDI3kH7aHQ=
-github.com/minio/sio v0.2.1/go.mod h1:8b0yPp2avGThviy/+OCJBI6OMpvxoUuiLvE6F1lebhw=
 github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
 github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
-github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
 github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
@@ -50,20 +36,18 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=
 github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
-github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
-github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
+github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
+github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
 github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
 github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg=
 golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -72,14 +56,11 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
 golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=
 golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
 golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
diff --git a/pkg/credentials/iam_aws.go b/pkg/credentials/iam_aws.go
index 2ec0afc..b532bcb 100644
--- a/pkg/credentials/iam_aws.go
+++ b/pkg/credentials/iam_aws.go
@@ -59,6 +59,10 @@ const (
 	defaultECSRoleEndpoint      = "http://169.254.170.2"
 	defaultSTSRoleEndpoint      = "https://sts.amazonaws.com"
 	defaultIAMSecurityCredsPath = "/latest/meta-data/iam/security-credentials/"
+	tokenRequestTTLHeader       = "X-aws-ec2-metadata-token-ttl-seconds"
+	tokenPath                   = "/latest/api/token"
+	tokenTTL                    = "21600"
+	tokenRequestHeader          = "X-aws-ec2-metadata-token"
 )
 
 // NewIAM returns a pointer to a new Credentials object wrapping the IAM.
@@ -75,6 +79,7 @@ func NewIAM(endpoint string) *Credentials {
 // Error will be returned if the request fails, or unable to extract
 // the desired
 func (m *IAM) Retrieve() (Value, error) {
+	token := os.Getenv("AWS_CONTAINER_AUTHORIZATION_TOKEN")
 	var roleCreds ec2RoleCredRespBody
 	var err error
 
@@ -120,7 +125,7 @@ func (m *IAM) Retrieve() (Value, error) {
 				os.Getenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"))
 		}
 
-		roleCreds, err = getEcsTaskCredentials(m.Client, endpoint)
+		roleCreds, err = getEcsTaskCredentials(m.Client, endpoint, token)
 
 	case len(os.Getenv("AWS_CONTAINER_CREDENTIALS_FULL_URI")) > 0:
 		if len(endpoint) == 0 {
@@ -134,7 +139,7 @@ func (m *IAM) Retrieve() (Value, error) {
 			}
 		}
 
-		roleCreds, err = getEcsTaskCredentials(m.Client, endpoint)
+		roleCreds, err = getEcsTaskCredentials(m.Client, endpoint, token)
 
 	default:
 		roleCreds, err = getCredentials(m.Client, endpoint)
@@ -192,11 +197,14 @@ func getIAMRoleURL(endpoint string) (*url.URL, error) {
 // with the current EC2 service. If there are no credentials,
 // or there is an error making or receiving the request.
 // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
-func listRoleNames(client *http.Client, u *url.URL) ([]string, error) {
+func listRoleNames(client *http.Client, u *url.URL, token string) ([]string, error) {
 	req, err := http.NewRequest(http.MethodGet, u.String(), nil)
 	if err != nil {
 		return nil, err
 	}
+	if token != "" {
+		req.Header.Add(tokenRequestHeader, token)
+	}
 	resp, err := client.Do(req)
 	if err != nil {
 		return nil, err
@@ -219,12 +227,16 @@ func listRoleNames(client *http.Client, u *url.URL) ([]string, error) {
 	return credsList, nil
 }
 
-func getEcsTaskCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody, error) {
+func getEcsTaskCredentials(client *http.Client, endpoint string, token string) (ec2RoleCredRespBody, error) {
 	req, err := http.NewRequest(http.MethodGet, endpoint, nil)
 	if err != nil {
 		return ec2RoleCredRespBody{}, err
 	}
 
+	if token != "" {
+		req.Header.Set("Authorization", token)
+	}
+
 	resp, err := client.Do(req)
 	if err != nil {
 		return ec2RoleCredRespBody{}, err
@@ -242,12 +254,35 @@ func getEcsTaskCredentials(client *http.Client, endpoint string) (ec2RoleCredRes
 	return respCreds, nil
 }
 
+func fetchIMDSToken(client *http.Client, endpoint string) (string, error) {
+	req, err := http.NewRequest(http.MethodPut, endpoint+tokenPath, nil)
+	if err != nil {
+		return "", err
+	}
+	req.Header.Add(tokenRequestTTLHeader, tokenTTL)
+	resp, err := client.Do(req)
+	if err != nil {
+		return "", err
+	}
+	defer resp.Body.Close()
+	data, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		return "", err
+	}
+	if resp.StatusCode != http.StatusOK {
+		return "", errors.New(resp.Status)
+	}
+	return string(data), nil
+}
+
 // getCredentials - obtains the credentials from the IAM role name associated with
 // the current EC2 service.
 //
 // If the credentials cannot be found, or there is an error
 // reading the response an error will be returned.
 func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody, error) {
+	// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
+	token, _ := fetchIMDSToken(client, endpoint)
 
 	// http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
 	u, err := getIAMRoleURL(endpoint)
@@ -256,7 +291,7 @@ func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody,
 	}
 
 	// http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
-	roleNames, err := listRoleNames(client, u)
+	roleNames, err := listRoleNames(client, u, token)
 	if err != nil {
 		return ec2RoleCredRespBody{}, err
 	}
@@ -280,6 +315,9 @@ func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody,
 	if err != nil {
 		return ec2RoleCredRespBody{}, err
 	}
+	if token != "" {
+		req.Header.Add(tokenRequestHeader, token)
+	}
 
 	resp, err := client.Do(req)
 	if err != nil {
diff --git a/pkg/lifecycle/lifecycle.go b/pkg/lifecycle/lifecycle.go
index cdf887a..b6f9601 100644
--- a/pkg/lifecycle/lifecycle.go
+++ b/pkg/lifecycle/lifecycle.go
@@ -142,9 +142,9 @@ func (t Transition) MarshalXML(en *xml.Encoder, startElement xml.StartElement) e
 
 // And And Rule for LifecycleTag, to be used in LifecycleRuleFilter
 type And struct {
-	XMLName xml.Name `xml:"And,omitempty" json:"-"`
-	Prefix  string   `xml:"Prefix,omitempty" json:"Prefix,omitempty"`
-	Tags    []Tag    `xml:"Tag,omitempty" json:"Tags,omitempty"`
+	XMLName xml.Name `xml:"And" json:"-"`
+	Prefix  string   `xml:"Prefix" json:"Prefix,omitempty"`
+	Tags    []Tag    `xml:"Tag" json:"Tags,omitempty"`
 }
 
 // IsEmpty returns true if Tags field is null
diff --git a/pkg/replication/replication.go b/pkg/replication/replication.go
index 89d8a80..beacc71 100644
--- a/pkg/replication/replication.go
+++ b/pkg/replication/replication.go
@@ -27,7 +27,7 @@ import (
 	"github.com/rs/xid"
 )
 
-var errInvalidFilter = fmt.Errorf("Invalid filter")
+var errInvalidFilter = fmt.Errorf("invalid filter")
 
 // OptionType specifies operation to be performed on config
 type OptionType string
@@ -46,19 +46,21 @@ const (
 
 // Options represents options to set a replication configuration rule
 type Options struct {
-	Op                     OptionType
-	ID                     string
-	Prefix                 string
-	RuleStatus             string
-	Priority               string
-	TagString              string
-	StorageClass           string
-	RoleArn                string
-	DestBucket             string
-	IsTagSet               bool
-	IsSCSet                bool
-	ReplicateDeletes       string // replicate versioned deletes
-	ReplicateDeleteMarkers string // replicate soft deletes
+	Op                      OptionType
+	ID                      string
+	Prefix                  string
+	RuleStatus              string
+	Priority                string
+	TagString               string
+	StorageClass            string
+	RoleArn                 string
+	DestBucket              string
+	IsTagSet                bool
+	IsSCSet                 bool
+	ReplicateDeletes        string // replicate versioned deletes
+	ReplicateDeleteMarkers  string // replicate soft deletes
+	ReplicaSync             string // replicate replica metadata modifications
+	ExistingObjectReplicate string
 }
 
 // Tags returns a slice of tags for a rule
@@ -71,7 +73,7 @@ func (opts Options) Tags() ([]Tag, error) {
 		}
 		kv := strings.SplitN(tok, "=", 2)
 		if len(kv) != 2 {
-			return []Tag{}, fmt.Errorf("Tags should be entered as comma separated k=v pairs")
+			return []Tag{}, fmt.Errorf("tags should be entered as comma separated k=v pairs")
 		}
 		tagList = append(tagList, Tag{
 			Key:   kv[0],
@@ -102,7 +104,7 @@ func (c *Config) AddRule(opts Options) error {
 		return err
 	}
 	if opts.RoleArn != c.Role && c.Role != "" {
-		return fmt.Errorf("Role ARN does not match existing configuration")
+		return fmt.Errorf("role ARN does not match existing configuration")
 	}
 	var status Status
 	// toggle rule status for edit option
@@ -112,7 +114,7 @@ func (c *Config) AddRule(opts Options) error {
 	case "disable":
 		status = Disabled
 	default:
-		return fmt.Errorf("Rule state should be either [enable|disable]")
+		return fmt.Errorf("rule state should be either [enable|disable]")
 	}
 
 	tags, err := opts.Tags()
@@ -142,7 +144,7 @@ func (c *Config) AddRule(opts Options) error {
 		arnStr = c.Role
 	}
 	if arnStr == "" {
-		return fmt.Errorf("Role ARN required")
+		return fmt.Errorf("role ARN required")
 	}
 	tokens := strings.Split(arnStr, ":")
 	if len(tokens) != 6 {
@@ -183,7 +185,28 @@ func (c *Config) AddRule(opts Options) error {
 			return fmt.Errorf("ReplicateDeletes should be either enable|disable")
 		}
 	}
+	var replicaSync Status
+	// replica sync is by default Enabled, unless specified.
+	switch opts.ReplicaSync {
+	case "enable", "":
+		replicaSync = Enabled
+	case "disable":
+		replicaSync = Disabled
+	default:
+		return fmt.Errorf("replica metadata sync should be either [enable|disable]")
+	}
 
+	var existingStatus Status
+	if opts.ExistingObjectReplicate != "" {
+		switch opts.ExistingObjectReplicate {
+		case "enable":
+			existingStatus = Enabled
+		case "disable", "":
+			existingStatus = Disabled
+		default:
+			return fmt.Errorf("existingObjectReplicate should be either enable|disable")
+		}
+	}
 	newRule := Rule{
 		ID:       opts.ID,
 		Priority: priority,
@@ -200,9 +223,13 @@ func (c *Config) AddRule(opts Options) error {
 		// However AWS leaves this configurable https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-for-metadata-changes.html
 		SourceSelectionCriteria: SourceSelectionCriteria{
 			ReplicaModifications: ReplicaModifications{
-				Status: Enabled,
+				Status: replicaSync,
 			},
 		},
+		// By default disable existing object replication unless selected
+		ExistingObjectReplication: ExistingObjectReplication{
+			Status: existingStatus,
+		},
 	}
 
 	// validate rule after overlaying priority for pre-existing rule being disabled.
@@ -211,13 +238,13 @@ func (c *Config) AddRule(opts Options) error {
 	}
 	for _, rule := range c.Rules {
 		if rule.Priority == newRule.Priority {
-			return fmt.Errorf("Priority must be unique. Replication configuration already has a rule with this priority")
+			return fmt.Errorf("priority must be unique. Replication configuration already has a rule with this priority")
 		}
 		if rule.Destination.Bucket != newRule.Destination.Bucket {
-			return fmt.Errorf("The destination bucket must be same for all rules")
+			return fmt.Errorf("the destination bucket must be same for all rules")
 		}
 		if rule.ID == newRule.ID {
-			return fmt.Errorf("A rule exists with this ID")
+			return fmt.Errorf("a rule exists with this ID")
 		}
 	}
 
@@ -228,7 +255,7 @@ func (c *Config) AddRule(opts Options) error {
 // EditRule modifies an existing rule in replication config
 func (c *Config) EditRule(opts Options) error {
 	if opts.ID == "" {
-		return fmt.Errorf("Rule ID missing")
+		return fmt.Errorf("rule ID missing")
 	}
 	rIdx := -1
 	var newRule Rule
@@ -240,7 +267,7 @@ func (c *Config) EditRule(opts Options) error {
 		}
 	}
 	if rIdx < 0 {
-		return fmt.Errorf("Rule with ID %s not found in replication configuration", opts.ID)
+		return fmt.Errorf("rule with ID %s not found in replication configuration", opts.ID)
 	}
 	prefixChg := opts.Prefix != newRule.Prefix()
 	if opts.IsTagSet || prefixChg {
@@ -286,7 +313,7 @@ func (c *Config) EditRule(opts Options) error {
 		case "disable":
 			newRule.Status = Disabled
 		default:
-			return fmt.Errorf("Rule state should be either [enable|disable]")
+			return fmt.Errorf("rule state should be either [enable|disable]")
 		}
 	}
 	// set DeleteMarkerReplication rule status for edit option
@@ -314,6 +341,27 @@ func (c *Config) EditRule(opts Options) error {
 		}
 	}
 
+	if opts.ReplicaSync != "" {
+		switch opts.ReplicaSync {
+		case "enable", "":
+			newRule.SourceSelectionCriteria.ReplicaModifications.Status = Enabled
+		case "disable":
+			newRule.SourceSelectionCriteria.ReplicaModifications.Status = Disabled
+		default:
+			return fmt.Errorf("replica metadata sync should be either [enable|disable]")
+		}
+	}
+	fmt.Println("opts.ExistingObjectReplicate>", opts.ExistingObjectReplicate)
+	if opts.ExistingObjectReplicate != "" {
+		switch opts.ExistingObjectReplicate {
+		case "enable":
+			newRule.ExistingObjectReplication.Status = Enabled
+		case "disable":
+			newRule.ExistingObjectReplication.Status = Disabled
+		default:
+			return fmt.Errorf("existingObjectsReplication state should be either [enable|disable]")
+		}
+	}
 	if opts.IsSCSet {
 		newRule.Destination.StorageClass = opts.StorageClass
 	}
@@ -343,10 +391,10 @@ func (c *Config) EditRule(opts Options) error {
 	// ensure priority and destination bucket restrictions are not violated
 	for idx, rule := range c.Rules {
 		if rule.Priority == newRule.Priority && rIdx != idx {
-			return fmt.Errorf("Priority must be unique. Replication configuration already has a rule with this priority")
+			return fmt.Errorf("priority must be unique. Replication configuration already has a rule with this priority")
 		}
 		if rule.Destination.Bucket != newRule.Destination.Bucket {
-			return fmt.Errorf("The destination bucket must be same for all rules")
+			return fmt.Errorf("the destination bucket must be same for all rules")
 		}
 	}
 
@@ -369,7 +417,7 @@ func (c *Config) RemoveRule(opts Options) error {
 		return fmt.Errorf("Rule with ID %s not found", opts.ID)
 	}
 	if len(newRules) == 0 {
-		return fmt.Errorf("Replication configuration should have at least one rule")
+		return fmt.Errorf("replication configuration should have at least one rule")
 	}
 	c.Rules = newRules
 	return nil
@@ -378,15 +426,16 @@ func (c *Config) RemoveRule(opts Options) error {
 
 // Rule - a rule for replication configuration.
 type Rule struct {
-	XMLName                 xml.Name                `xml:"Rule" json:"-"`
-	ID                      string                  `xml:"ID,omitempty"`
-	Status                  Status                  `xml:"Status"`
-	Priority                int                     `xml:"Priority"`
-	DeleteMarkerReplication DeleteMarkerReplication `xml:"DeleteMarkerReplication"`
-	DeleteReplication       DeleteReplication       `xml:"DeleteReplication"`
-	Destination             Destination             `xml:"Destination"`
-	Filter                  Filter                  `xml:"Filter" json:"Filter"`
-	SourceSelectionCriteria SourceSelectionCriteria `xml:"SourceSelectionCriteria" json:"SourceSelectionCriteria"`
+	XMLName                   xml.Name                  `xml:"Rule" json:"-"`
+	ID                        string                    `xml:"ID,omitempty"`
+	Status                    Status                    `xml:"Status"`
+	Priority                  int                       `xml:"Priority"`
+	DeleteMarkerReplication   DeleteMarkerReplication   `xml:"DeleteMarkerReplication"`
+	DeleteReplication         DeleteReplication         `xml:"DeleteReplication"`
+	Destination               Destination               `xml:"Destination"`
+	Filter                    Filter                    `xml:"Filter" json:"Filter"`
+	SourceSelectionCriteria   SourceSelectionCriteria   `xml:"SourceSelectionCriteria" json:"SourceSelectionCriteria"`
+	ExistingObjectReplication ExistingObjectReplication `xml:"ExistingObjectReplication,omitempty" json:"ExistingObjectReplication,omitempty"`
 }
 
 // Validate validates the rule for correctness
@@ -402,14 +451,13 @@ func (r Rule) Validate() error {
 	}
 
 	if r.Priority < 0 && r.Status == Enabled {
-		return fmt.Errorf("Priority must be set for the rule")
+		return fmt.Errorf("priority must be set for the rule")
 	}
 
 	if err := r.validateStatus(); err != nil {
 		return err
 	}
-
-	return nil
+	return r.ExistingObjectReplication.Validate()
 }
 
 // validateID - checks if ID is valid or not.
@@ -525,11 +573,11 @@ func (tag Tag) IsEmpty() bool {
 // Validate checks this tag.
 func (tag Tag) Validate() error {
 	if len(tag.Key) == 0 || utf8.RuneCountInString(tag.Key) > 128 {
-		return fmt.Errorf("Invalid Tag Key")
+		return fmt.Errorf("invalid Tag Key")
 	}
 
 	if utf8.RuneCountInString(tag.Value) > 256 {
-		return fmt.Errorf("Invalid Tag Value")
+		return fmt.Errorf("invalid Tag Value")
 	}
 	return nil
 }
@@ -585,7 +633,7 @@ func (d DeleteReplication) IsEmpty() bool {
 
 // ReplicaModifications specifies if replica modification sync is enabled
 type ReplicaModifications struct {
-	Status Status `xml:"Status" json:"Status"`
+	Status Status `xml:"Status" json:"Status"` // should be set to "Enabled" by default
 }
 
 // SourceSelectionCriteria - specifies additional source selection criteria in ReplicationConfiguration.
@@ -609,6 +657,27 @@ func (s SourceSelectionCriteria) Validate() error {
 	return nil
 }
 
+// ExistingObjectReplication - whether existing object replication is enabled
+type ExistingObjectReplication struct {
+	Status Status `xml:"Status"` // should be set to "Disabled" by default
+}
+
+// IsEmpty returns true if DeleteMarkerReplication is not set
+func (e ExistingObjectReplication) IsEmpty() bool {
+	return len(e.Status) == 0
+}
+
+// Validate validates whether the status is disabled.
+func (e ExistingObjectReplication) Validate() error {
+	if e.IsEmpty() {
+		return nil
+	}
+	if e.Status != Disabled && e.Status != Enabled {
+		return fmt.Errorf("invalid ExistingObjectReplication status")
+	}
+	return nil
+}
+
 // Metrics represents inline replication metrics
 // such as pending, failed and completed bytes in total for a bucket
 type Metrics struct {


Test patch:
diff --git a/functional_tests.go b/functional_tests.go
index 8758c8e..ba7ff57 100644
--- a/functional_tests.go
+++ b/functional_tests.go
@@ -1,4 +1,4 @@
-// +build ignore
+// +build mint
 
 /*
  * MinIO Go Library for Amazon S3 Compatible Cloud Storage
@@ -24,6 +24,7 @@ import (
 	"context"
 	"errors"
 	"fmt"
+	"hash/crc32"
 	"io"
 	"io/ioutil"
 	"math/rand"
@@ -61,6 +62,7 @@ const (
 	accessKey      = "ACCESS_KEY"
 	secretKey      = "SECRET_KEY"
 	enableHTTPS    = "ENABLE_HTTPS"
+	enableKMS      = "ENABLE_KMS"
 )
 
 type mintJSONFormatter struct {
@@ -245,6 +247,9 @@ func cleanupVersionedBucket(bucketName string, c *minio.Client) error {
 	// objects are already deleted, clear the buckets now
 	err := c.RemoveBucket(context.Background(), bucketName)
 	if err != nil {
+		for obj := range c.ListObjects(context.Background(), bucketName, minio.ListObjectsOptions{WithVersions: true, Recursive: true}) {
+			log.Println("found", obj.Key, obj.VersionID)
+		}
 		return err
 	}
 	return err
@@ -274,37 +279,61 @@ func getMintDataDirFilePath(filename string) (fp string) {
 	return filepath.Join(mintDataDir, filename)
 }
 
-type sizedReader struct {
-	io.Reader
-	size int
+func newRandomReader(seed, size int64) io.Reader {
+	return io.LimitReader(rand.New(rand.NewSource(seed)), size)
 }
 
-func (l *sizedReader) Size() int {
-	return l.size
+func mustCrcReader(r io.Reader) uint32 {
+	crc := crc32.NewIEEE()
+	_, err := io.Copy(crc, r)
+	if err != nil {
+		panic(err)
+	}
+	return crc.Sum32()
 }
 
-func (l *sizedReader) Close() error {
+func crcMatches(r io.Reader, want uint32) error {
+	crc := crc32.NewIEEE()
+	_, err := io.Copy(crc, r)
+	if err != nil {
+		panic(err)
+	}
+	got := crc.Sum32()
+	if got != want {
+		return fmt.Errorf("crc mismatch, want %x, got %x", want, got)
+	}
 	return nil
 }
 
-type randomReader struct{ seed []byte }
-
-func (r *randomReader) Read(b []byte) (int, error) {
-	return copy(b, bytes.Repeat(r.seed, len(b))), nil
+func crcMatchesName(r io.Reader, name string) error {
+	want := dataFileCRC32[name]
+	crc := crc32.NewIEEE()
+	_, err := io.Copy(crc, r)
+	if err != nil {
+		panic(err)
+	}
+	got := crc.Sum32()
+	if got != want {
+		return fmt.Errorf("crc mismatch, want %x, got %x", want, got)
+	}
+	return nil
 }
 
 // read data from file if it exists or optionally create a buffer of particular size
 func getDataReader(fileName string) io.ReadCloser {
 	if mintDataDir == "" {
-		size := dataFileMap[fileName]
-		return &sizedReader{
-			Reader: io.LimitReader(&randomReader{
-				seed: []byte("a"),
-			}, int64(size)),
-			size: size,
+		size := int64(dataFileMap[fileName])
+		if _, ok := dataFileCRC32[fileName]; !ok {
+			dataFileCRC32[fileName] = mustCrcReader(newRandomReader(size, size))
 		}
+		return ioutil.NopCloser(newRandomReader(size, size))
 	}
 	reader, _ := os.Open(getMintDataDirFilePath(fileName))
+	if _, ok := dataFileCRC32[fileName]; !ok {
+		dataFileCRC32[fileName] = mustCrcReader(reader)
+		reader.Close()
+		reader, _ = os.Open(getMintDataDirFilePath(fileName))
+	}
 	return reader
 }
 
@@ -327,7 +356,9 @@ func randString(n int, src rand.Source, prefix string) string {
 }
 
 var dataFileMap = map[string]int{
+	"datafile-0-b":     0,
 	"datafile-1-b":     1,
+	"datafile-1-kB":    1 * humanize.KiByte,
 	"datafile-10-kB":   10 * humanize.KiByte,
 	"datafile-33-kB":   33 * humanize.KiByte,
 	"datafile-100-kB":  100 * humanize.KiByte,
@@ -336,9 +367,12 @@ var dataFileMap = map[string]int{
 	"datafile-5-MB":    5 * humanize.MiByte,
 	"datafile-6-MB":    6 * humanize.MiByte,
 	"datafile-11-MB":   11 * humanize.MiByte,
+	"datafile-65-MB":   65 * humanize.MiByte,
 	"datafile-129-MB":  129 * humanize.MiByte,
 }
 
+var dataFileCRC32 = map[string]uint32{}
+
 func isFullMode() bool {
 	return os.Getenv("MINT_MODE") == "full"
 }
@@ -625,6 +659,10 @@ func testPutObjectReadAt() {
 		logError(testName, function, args, startTime, "", "Content types don't match", err)
 		return
 	}
+	if err := crcMatchesName(r, "datafile-129-MB"); err != nil {
+		logError(testName, function, args, startTime, "", "data CRC check failed", err)
+		return
+	}
 	if err := r.Close(); err != nil {
 		logError(testName, function, args, startTime, "", "Object Close failed", err)
 		return
@@ -1723,6 +1761,10 @@ func testPutObjectWithMetadata() {
 		logError(testName, function, args, startTime, "", "ContentType does not match, expected "+customContentType+" got "+st.ContentType, err)
 		return
 	}
+	if err := crcMatchesName(r, "datafile-129-MB"); err != nil {
+		logError(testName, function, args, startTime, "", "data CRC check failed", err)
+		return
+	}
 	if err := r.Close(); err != nil {
 		logError(testName, function, args, startTime, "", "Object Close failed", err)
 		return
@@ -1780,7 +1822,7 @@ func testPutObjectWithContentLanguage() {
 
 	defer cleanupBucket(bucketName, c)
 
-	data := bytes.Repeat([]byte("a"), int(0))
+	data := []byte{}
 	_, err = c.PutObject(context.Background(), bucketName, objectName, bytes.NewReader(data), int64(0), minio.PutObjectOptions{
 		ContentLanguage: "en",
 	})
@@ -1853,8 +1895,8 @@ func testPutObjectStreaming() {
 	sizes := []int64{0, 64*1024 - 1, 64 * 1024}
 
 	for _, size := range sizes {
-		data := bytes.Repeat([]byte("a"), int(size))
-		ui, err := c.PutObject(context.Background(), bucketName, objectName, bytes.NewReader(data), int64(size), minio.PutObjectOptions{})
+		data := newRandomReader(size, size)
+		ui, err := c.PutObject(context.Background(), bucketName, objectName, data, int64(size), minio.PutObjectOptions{})
 		if err != nil {
 			logError(testName, function, args, startTime, "", "PutObjectStreaming failed", err)
 			return
@@ -2074,6 +2116,10 @@ func testGetObjectClosedTwice() {
 		logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+" got "+string(st.Size), err)
 		return
 	}
+	if err := crcMatchesName(r, "datafile-33-kB"); err != nil {
+		logError(testName, function, args, startTime, "", "data CRC check failed", err)
+		return
+	}
 	if err := r.Close(); err != nil {
 		logError(testName, function, args, startTime, "", "Object Close failed", err)
 		return
@@ -2483,12 +2529,12 @@ func testFPutObject() {
 		logError(testName, function, args, startTime, "", "File create failed", err)
 		return
 	}
-	defer tmpFile.Close()
 	_, err = io.Copy(tmpFile, srcFile)
 	if err != nil {
 		logError(testName, function, args, startTime, "", "File copy failed", err)
 		return
 	}
+	tmpFile.Close()
 
 	// Perform FPutObject with no contentType provided (Expecting application/x-gtar)
 	args["objectName"] = objectName + "-GTar"
@@ -2794,9 +2840,9 @@ func testPutObjectContext() {
 	args["objectName"] = objectName
 
 	ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
+	cancel()
 	args["ctx"] = ctx
 	args["opts"] = minio.PutObjectOptions{ContentType: "binary/octet-stream"}
-	defer cancel()
 
 	_, err = c.PutObject(ctx, bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
 	if err == nil {
@@ -3623,6 +3669,14 @@ func testCopyObject() {
 		return
 	}
 
+	if err := crcMatchesName(r, "datafile-33-kB"); err != nil {
+		logError(testName, function, args, startTime, "", "data CRC check failed", err)
+		return
+	}
+	if err := crcMatchesName(readerCopy, "datafile-33-kB"); err != nil {
+		logError(testName, function, args, startTime, "", "copy data CRC check failed", err)
+		return
+	}
 	// Close all the get readers before proceeding with CopyObject operations.
 	r.Close()
 	readerCopy.Close()
@@ -10406,7 +10460,7 @@ func testGetObjectContext() {
 
 	ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
 	args["ctx"] = ctx
-	defer cancel()
+	cancel()
 
 	r, err := c.GetObject(ctx, bucketName, objectName, minio.GetObjectOptions{})
 	if err != nil {
@@ -10537,6 +10591,117 @@ func testFGetObjectContext() {
 
 }
 
+// Test get object with GetObject with a user provided context
+func testGetObjectRanges() {
+	// initialize logging params
+	startTime := time.Now()
+	testName := getFuncName()
+	function := "GetObject(ctx, bucketName, objectName, fileName)"
+	args := map[string]interface{}{
+		"ctx":        "",
+		"bucketName": "",
+		"objectName": "",
+		"fileName":   "",
+	}
+	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
+	defer cancel()
+
+	rng := rand.NewSource(time.Now().UnixNano())
+	// Instantiate new minio client object.
+	c, err := minio.New(os.Getenv(serverEndpoint),
+		&minio.Options{
+			Creds:  credentials.NewStaticV4(os.Getenv(accessKey), os.Getenv(secretKey), ""),
+			Secure: mustParseBool(os.Getenv(enableHTTPS)),
+		})
+	if err != nil {
+		logError(testName, function, args, startTime, "", "MinIO client v4 object creation failed", err)
+		return
+	}
+
+	// Enable tracing, write to stderr.
+	// c.TraceOn(os.Stderr)
+
+	// Set user agent.
+	c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
+
+	// Generate a new random bucket name.
+	bucketName := randString(60, rng, "minio-go-test-")
+	args["bucketName"] = bucketName
+
+	// Make a new bucket.
+	err = c.MakeBucket(context.Background(), bucketName, minio.MakeBucketOptions{Region: "us-east-1"})
+	if err != nil {
+		logError(testName, function, args, startTime, "", "MakeBucket failed", err)
+		return
+	}
+
+	defer cleanupBucket(bucketName, c)
+
+	bufSize := dataFileMap["datafile-129-MB"]
+	var reader = getDataReader("datafile-129-MB")
+	defer reader.Close()
+	// Save the data
+	objectName := randString(60, rng, "")
+	args["objectName"] = objectName
+
+	_, err = c.PutObject(context.Background(), bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
+	if err != nil {
+		logError(testName, function, args, startTime, "", "PutObject failed", err)
+		return
+	}
+
+	// Read the data back
+	tests := []struct {
+		start int64
+		end   int64
+	}{
+		{
+			start: 1024,
+			end:   1024 + 1<<20,
+		},
+		{
+			start: 20e6,
+			end:   20e6 + 10000,
+		},
+		{
+			start: 40e6,
+			end:   40e6 + 10000,
+		},
+		{
+			start: 60e6,
+			end:   60e6 + 10000,
+		},
+		{
+			start: 80e6,
+			end:   80e6 + 10000,
+		},
+		{
+			start: 120e6,
+			end:   int64(bufSize),
+		},
+	}
+	for _, test := range tests {
+		wantRC := getDataReader("datafile-129-MB")
+		io.CopyN(ioutil.Discard, wantRC, test.start)
+		want := mustCrcReader(io.LimitReader(wantRC, test.end-test.start+1))
+		opts := minio.GetObjectOptions{}
+		opts.SetRange(test.start, test.end)
+		args["opts"] = fmt.Sprintf("%+v", test)
+		obj, err := c.GetObject(ctx, bucketName, objectName, opts)
+		if err != nil {
+			logError(testName, function, args, startTime, "", "FGetObject with long timeout failed", err)
+			return
+		}
+		err = crcMatches(obj, want)
+		if err != nil {
+			logError(testName, function, args, startTime, "", fmt.Sprintf("GetObject offset %d -> %d", test.start, test.end), err)
+			return
+		}
+	}
+
+	successLogger(testName, function, args, startTime).Info()
+}
+
 // Test get object ACLs with GetObjectACL with custom provided context
 func testGetObjectACLContext() {
 	// initialize logging params
@@ -10841,7 +11006,7 @@ func testGetObjectContextV2() {
 
 	ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
 	args["ctx"] = ctx
-	defer cancel()
+	cancel()
 
 	r, err := c.GetObject(ctx, bucketName, objectName, minio.GetObjectOptions{})
 	if err != nil {
@@ -11067,6 +11232,7 @@ func testListObjects() {
 
 	testList(c.ListObjects, bucketName, minio.ListObjectsOptions{Recursive: true, UseV1: true})
 	testList(c.ListObjects, bucketName, minio.ListObjectsOptions{Recursive: true})
+	testList(c.ListObjects, bucketName, minio.ListObjectsOptions{Recursive: true, WithMetadata: true})
 
 	successLogger(testName, function, args, startTime).Info()
 }
@@ -11125,6 +11291,17 @@ func testRemoveObjects() {
 	}
 	log.Println("Uploaded", objectName, " of size: ", n, "to bucket: ", bucketName, "Successfully.")
 
+	// Replace with smaller...
+	bufSize = dataFileMap["datafile-10-kB"]
+	reader = getDataReader("datafile-10-kB")
+	defer reader.Close()
+
+	n, err = c.PutObject(context.Background(), bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{})
+	if err != nil {
+		log.Fatalln(err)
+	}
+	log.Println("Uploaded", objectName, " of size: ", n, "to bucket: ", bucketName, "Successfully.")
+
 	t := time.Date(2030, time.April, 25, 14, 0, 0, 0, time.UTC)
 	m := minio.RetentionMode(minio.Governance)
 	opts := minio.PutObjectRetentionOptions{
@@ -11213,6 +11390,11 @@ func main() {
 	log.SetLevel(log.InfoLevel)
 
 	tls := mustParseBool(os.Getenv(enableHTTPS))
+	kms := mustParseBool(os.Getenv(enableKMS))
+	if os.Getenv(enableKMS) == "" {
+		// Default to KMS tests.
+		kms = true
+	}
 	// execute tests
 	if isFullMode() {
 		testMakeBucketErrorV2()
@@ -11221,6 +11403,7 @@ func main() {
 		testMakeBucketRegionsV2()
 		testGetObjectReadSeekFunctionalV2()
 		testGetObjectReadAtFunctionalV2()
+		testGetObjectRanges()
 		testCopyObjectV2()
 		testFunctionalV2()
 		testComposeObjectErrorCasesV2()
@@ -11300,16 +11483,18 @@ func main() {
 		}
 
 		// KMS tests
-		testSSES3EncryptionPutGet()
-		testSSES3EncryptionFPut()
-		testSSES3EncryptedGetObjectReadAtFunctional()
-		testSSES3EncryptedGetObjectReadSeekFunctional()
-		testEncryptedSSES3ToSSES3CopyObject()
-		testEncryptedSSES3ToUnencryptedCopyObject()
-		testUnencryptedToSSES3CopyObject()
-		testUnencryptedToSSES3CopyObjectPart()
-		testSSES3EncryptedToUnencryptedCopyPart()
-		testSSES3EncryptedToSSES3CopyObjectPart()
+		if kms {
+			testSSES3EncryptionPutGet()
+			testSSES3EncryptionFPut()
+			testSSES3EncryptedGetObjectReadAtFunctional()
+			testSSES3EncryptedGetObjectReadSeekFunctional()
+			testEncryptedSSES3ToSSES3CopyObject()
+			testEncryptedSSES3ToUnencryptedCopyObject()
+			testUnencryptedToSSES3CopyObject()
+			testUnencryptedToSSES3CopyObjectPart()
+			testSSES3EncryptedToUnencryptedCopyPart()
+			testSSES3EncryptedToSSES3CopyObjectPart()
+		}
 	} else {
 		testFunctional()
 		testFunctionalV2()
diff --git a/pkg/credentials/iam_aws_test.go b/pkg/credentials/iam_aws_test.go
index 9f28d18..686721d 100644
--- a/pkg/credentials/iam_aws_test.go
+++ b/pkg/credentials/iam_aws_test.go
@@ -25,6 +25,7 @@ import (
 	"net/http"
 	"net/http/httptest"
 	"os"
+	"strconv"
 	"testing"
 	"time"
 )
@@ -105,6 +106,40 @@ func initTestServer(expireOn string, failAssume bool) *httptest.Server {
 	return server
 }
 
+// Instance Metadata Service with V1 disabled.
+func initIMDSv2Server(expireOn string) *httptest.Server {
+	imdsToken := "IMDSTokenabc123=="
+	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		fmt.Println(r.URL.Path)
+		fmt.Println(r.Method)
+		if r.URL.Path == "/latest/api/token" && r.Method == "PUT" {
+			ttlHeader := r.Header.Get("X-aws-ec2-metadata-token-ttl-seconds")
+			ttl, err := strconv.ParseInt(ttlHeader, 10, 32)
+			if err != nil || ttl < 0 || ttl > 21600 {
+				http.Error(w, "", http.StatusBadRequest)
+				return
+			}
+			w.Header().Set("X-Aws-Ec2-Metadata-Token-Ttl-Seconds", ttlHeader)
+			w.Write([]byte(imdsToken))
+			return
+		}
+		token := r.Header.Get("X-aws-ec2-metadata-token")
+		if token != imdsToken {
+			http.Error(w, r.URL.Path, http.StatusUnauthorized)
+			return
+		}
+
+		if r.URL.Path == "/latest/meta-data/iam/security-credentials/" {
+			fmt.Fprintln(w, "RoleName")
+		} else if r.URL.Path == "/latest/meta-data/iam/security-credentials/RoleName" {
+			fmt.Fprintf(w, credsRespTmpl, expireOn)
+		} else {
+			http.Error(w, "bad request", http.StatusBadRequest)
+		}
+	}))
+	return server
+}
+
 func initEcsTaskTestServer(expireOn string) *httptest.Server {
 	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		fmt.Fprintf(w, credsRespEcsTaskTmpl, expireOn)
@@ -391,3 +426,15 @@ func TestStsCn(t *testing.T) {
 		t.Error("Expected creds to be expired.")
 	}
 }
+
+func TestIMDSv1Blocked(t *testing.T) {
+	server := initIMDSv2Server("2014-12-16T01:51:37Z")
+	p := &IAM{
+		Client:   http.DefaultClient,
+		Endpoint: server.URL,
+	}
+	_, err := p.Retrieve()
+	if err != nil {
+		t.Errorf("Unexpected IMDSv2 failure %s", err)
+	}
+}
diff --git a/pkg/replication/replication_test.go b/pkg/replication/replication_test.go
index 726b9a4..326e6cf 100644
--- a/pkg/replication/replication_test.go
+++ b/pkg/replication/replication_test.go
@@ -54,7 +54,7 @@ func TestAddReplicationRule(t *testing.T) {
 				RoleArn:      "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
 				DestBucket:   "arn:aws:s3:::destbucket",
 			},
-			expectedErr: "Rule state should be either [enable|disable]",
+			expectedErr: "rule state should be either [enable|disable]",
 		},
 		{ //test case :3
 			cfg: Config{Rules: []Rule{{Priority: 1}}},
@@ -68,7 +68,7 @@ func TestAddReplicationRule(t *testing.T) {
 				RoleArn:      "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
 				DestBucket:   "arn:aws:s3:::destbucket",
 			},
-			expectedErr: "Priority must be unique. Replication configuration already has a rule with this priority",
+			expectedErr: "priority must be unique. Replication configuration already has a rule with this priority",
 		},
 		{ //test case :4
 			cfg: Config{},
@@ -111,7 +111,7 @@ func TestAddReplicationRule(t *testing.T) {
 				RoleArn:      "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
 				DestBucket:   "arn:aws:s3:::destbucket",
 			},
-			expectedErr: "Role ARN does not match existing configuration",
+			expectedErr: "role ARN does not match existing configuration",
 		},
 		{ //test case :7
 			cfg: Config{},
@@ -139,7 +139,7 @@ func TestAddReplicationRule(t *testing.T) {
 				RoleArn:      "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
 				DestBucket:   "arn:aws:s3:::destbucket",
 			},
-			expectedErr: "A rule exists with this ID",
+			expectedErr: "a rule exists with this ID",
 		},
 	}
 	for i, testCase := range testCases {
@@ -201,7 +201,7 @@ func TestEditReplicationRule(t *testing.T) {
 				RoleArn:      "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
 				DestBucket:   "arn:aws:s3:::destbucket",
 			},
-			expectedErr: "Rule with ID xyz.id not found in replication configuration",
+			expectedErr: "rule with ID xyz.id not found in replication configuration",
 		},
 		{ //test case :3 missing rule id
 			cfg: Config{
@@ -221,7 +221,7 @@ func TestEditReplicationRule(t *testing.T) {
 				RoleArn:      "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
 				DestBucket:   "arn:aws:s3:::destbucket",
 			},
-			expectedErr: "Rule ID missing",
+			expectedErr: "rule ID missing",
 		},
 		{ //test case :4 different destination bucket
 			cfg: Config{
@@ -242,7 +242,7 @@ func TestEditReplicationRule(t *testing.T) {
 				RoleArn:      "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
 				DestBucket:   "arn:aws:s3:::differentbucket",
 			},
-			expectedErr: "The destination bucket must be same for all rules",
+			expectedErr: "the destination bucket must be same for all rules",
 		},
 		{ //test case :5 invalid destination bucket arn format
 			cfg: Config{
@@ -285,7 +285,7 @@ func TestEditReplicationRule(t *testing.T) {
 				RoleArn:      "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
 				DestBucket:   "arn:aws:s3:::destbucket",
 			},
-			expectedErr: "Rule state should be either [enable|disable]",
+			expectedErr: "rule state should be either [enable|disable]",
 		},
 		{ //test case :7 another rule has same priority
 			cfg: Config{
@@ -312,7 +312,7 @@ func TestEditReplicationRule(t *testing.T) {
 				RoleArn:      "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
 				DestBucket:   "arn:aws:s3:::destbucket",
 			},
-			expectedErr: "Priority must be unique. Replication configuration already has a rule with this priority",
+			expectedErr: "priority must be unique. Replication configuration already has a rule with this priority",
 		},
 	}