add gocritic/ruleguard checks back again, cleanup code. (#13665)

- remove some duplicated code
- reported a bug, separately fixed in #13664
- using strings.ReplaceAll() when needed
- using filepath.ToSlash() use when needed
- remove all non-Go style comments from the codebase

Co-authored-by: Aditya Manthramurthy <donatello@users.noreply.github.com>
This commit is contained in:
Harshavardhana
2021-11-16 09:28:29 -08:00
committed by GitHub
parent 07c5e72cdb
commit 661b263e77
111 changed files with 409 additions and 450 deletions

View File

@@ -37,7 +37,7 @@ type Destination struct {
Bucket string `xml:"Bucket" json:"Bucket"`
StorageClass string `xml:"StorageClass" json:"StorageClass"`
ARN string
//EncryptionConfiguration TODO: not needed for MinIO
// EncryptionConfiguration TODO: not needed for MinIO
}
func (d Destination) isValidStorageClass() bool {
@@ -57,14 +57,14 @@ func (d Destination) String() string {
}
//LegacyArn returns true if arn format has prefix "arn:aws:s3:::" which was used
// prior to multi-destination
// LegacyArn returns true if arn format has prefix "arn:aws:s3:::" which was
// used prior to multi-destination
func (d Destination) LegacyArn() bool {
return strings.HasPrefix(d.ARN, DestinationARNPrefix)
}
//TargetArn returns true if arn format has prefix "arn:minio:replication:::" used
// for multi-destination targets
// TargetArn returns true if arn format has prefix "arn:minio:replication:::"
// used for multi-destination targets
func (d Destination) TargetArn() bool {
return strings.HasPrefix(d.ARN, DestinationARNMinIOPrefix)
}