Fix lint issues from v1.62.0 upgrade (#20633)

* Fix lint issues from v1.62.0 upgrade

* Fix xlMetaV2TrimData version checks.
This commit is contained in:
Klaus Post
2024-11-11 06:51:43 -08:00
committed by GitHub
parent e6ca6de194
commit 4972735507
17 changed files with 89 additions and 88 deletions

View File

@@ -378,11 +378,11 @@ func (x *xlMetaInlineData) remove(keys ...string) bool {
// xlMetaV2TrimData will trim any data from the metadata without unmarshalling it.
// If any error occurs the unmodified data is returned.
func xlMetaV2TrimData(buf []byte) []byte {
metaBuf, min, maj, err := checkXL2V1(buf)
metaBuf, maj, minor, err := checkXL2V1(buf)
if err != nil {
return buf
}
if maj == 1 && min < 1 {
if maj == 1 && minor < 1 {
// First version to carry data.
return buf
}
@@ -393,7 +393,7 @@ func xlMetaV2TrimData(buf []byte) []byte {
return buf
}
// Skip CRC
if maj > 1 || min >= 2 {
if maj > 1 || minor >= 2 {
_, metaBuf, err = msgp.ReadUint32Bytes(metaBuf)
storageLogIf(GlobalContext, err)
}