Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

build: fix gocritic lint issue underef

albertony4454ed9d3bc6
diff --git a/backend/crypt/cipher.go b/backend/crypt/cipher.go
index 57a44b3e3..4fd529175 100644
--- a/backend/crypt/cipher.go
+++ b/backend/crypt/cipher.go
@@ -888,7 +888,7 @@ func (fh *decrypter) fillBuffer() (err error) {
fs.Errorf(nil, "crypt: ignoring: %v", ErrorEncryptedBadBlock)
// Zero out the bad block and continue
for i := range (*fh.buf)[:n] {
- (*fh.buf)[i] = 0
+ fh.buf[i] = 0
}
}
fh.bufIndex = 0
diff --git a/backend/s3/s3.go b/backend/s3/s3.go
index b691a2cf3..46426e77e 100644
--- a/backend/s3/s3.go
+++ b/backend/s3/s3.go
@@ -3889,7 +3889,7 @@ func versionLess(a, b *types.ObjectVersion) bool {
if *a.Key > *b.Key {
return false
}
- dt := (*a.LastModified).Sub(*b.LastModified)
+ dt := a.LastModified.Sub(*b.LastModified)
if dt > 0 {
return true
}
@@ -5601,8 +5601,8 @@ func (o *Object) setMetaData(resp *s3.HeadObjectOutput) {
// it from listings then it may have millisecond precision, but
// if we read it from a HEAD/GET request then it will have
// second precision.
- equalToWithinOneSecond := o.lastModified.Truncate(time.Second).Equal((*resp.LastModified).Truncate(time.Second))
- newHasNs := (*resp.LastModified).Nanosecond() != 0
+ equalToWithinOneSecond := o.lastModified.Truncate(time.Second).Equal(resp.LastModified.Truncate(time.Second))
+ newHasNs := resp.LastModified.Nanosecond() != 0
if !equalToWithinOneSecond || newHasNs {
o.lastModified = *resp.LastModified
}