build: fix gocritic lint issue underef

This commit is contained in:
albertony 2024-05-31 15:14:40 +02:00 committed by Nick Craig-Wood
parent bad8207378
commit 4454ed9d3b
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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
}