Clear omitted fields (#20575)

Searched `msg:"[a-zA-Z0-9]*,omitempty` through the codebase.

Uses latest tinylib master.
This commit is contained in:
Klaus Post 2024-10-22 08:30:50 -07:00 committed by GitHub
parent 96ca402dcd
commit 51410c9023
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 250 additions and 4 deletions

View File

@ -24,7 +24,7 @@ help: ## print this help
getdeps: ## fetch necessary dependencies
@mkdir -p ${GOPATH}/bin
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOLANGCI_DIR)
@echo "Installing msgp" && go install -v github.com/tinylib/msgp@v1.1.10-0.20240227114326-6d6f813fff1b
@echo "Installing msgp" && go install -v github.com/tinylib/msgp@v1.2.3-0.20241022140105-4558fbf3a223
@echo "Installing stringer" && go install -v golang.org/x/tools/cmd/stringer@latest
crosscompile: ## cross compile minio

View File

@ -39,6 +39,8 @@ import (
"github.com/valyala/bytebufferpool"
)
//msgp:clearomitted
//go:generate msgp -file $GOFILE -unexported
// dataUsageHash is the hash type used.

View File

@ -1633,6 +1633,8 @@ func (z *dataUsageEntry) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -1725,6 +1727,7 @@ func (z *dataUsageEntry) DecodeMsg(dc *msgp.Reader) (err error) {
return
}
}
zb0001Mask |= 0x1
case "c":
z.Compacted, err = dc.ReadBool()
if err != nil {
@ -1739,6 +1742,12 @@ func (z *dataUsageEntry) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.AllTierStats = nil
}
}
return
}
@ -1952,6 +1961,8 @@ func (z *dataUsageEntry) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -2043,6 +2054,7 @@ func (z *dataUsageEntry) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
}
zb0001Mask |= 0x1
case "c":
z.Compacted, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
@ -2057,6 +2069,12 @@ func (z *dataUsageEntry) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.AllTierStats = nil
}
}
o = bts
return
}
@ -2628,6 +2646,8 @@ func (z *dataUsageEntryV7) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -2720,6 +2740,7 @@ func (z *dataUsageEntryV7) DecodeMsg(dc *msgp.Reader) (err error) {
return
}
}
zb0001Mask |= 0x1
case "c":
z.Compacted, err = dc.ReadBool()
if err != nil {
@ -2734,6 +2755,12 @@ func (z *dataUsageEntryV7) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.AllTierStats = nil
}
}
return
}
@ -2747,6 +2774,8 @@ func (z *dataUsageEntryV7) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -2838,6 +2867,7 @@ func (z *dataUsageEntryV7) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
}
zb0001Mask |= 0x1
case "c":
z.Compacted, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
@ -2852,6 +2882,12 @@ func (z *dataUsageEntryV7) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.AllTierStats = nil
}
}
o = bts
return
}

View File

@ -25,6 +25,8 @@ import (
xioutil "github.com/minio/minio/internal/ioutil"
)
//msgp:clearomitted
//go:generate msgp -file=$GOFILE
// DeleteOptions represents the disk level delete options available for the APIs

View File

@ -746,6 +746,8 @@ func (z *DeleteOptions) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -801,6 +803,7 @@ func (z *DeleteOptions) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "OldDataDir")
return
}
zb0001Mask |= 0x1
default:
err = dc.Skip()
if err != nil {
@ -809,6 +812,12 @@ func (z *DeleteOptions) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.OldDataDir = ""
}
}
return
}
@ -934,6 +943,8 @@ func (z *DeleteOptions) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -989,6 +1000,7 @@ func (z *DeleteOptions) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "OldDataDir")
return
}
zb0001Mask |= 0x1
default:
bts, err = msgp.Skip(bts)
if err != nil {
@ -997,6 +1009,12 @@ func (z *DeleteOptions) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.OldDataDir = ""
}
}
o = bts
return
}
@ -2453,6 +2471,9 @@ func (z *FileInfo) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "Data")
return
}
if z.Data == nil {
z.Data = make([]byte, 0)
}
}
z.NumVersions, err = dc.ReadInt()
if err != nil {
@ -2487,6 +2508,9 @@ func (z *FileInfo) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "Checksum")
return
}
if z.Checksum == nil {
z.Checksum = make([]byte, 0)
}
}
z.Versioned, err = dc.ReadBool()
if err != nil {
@ -2907,6 +2931,9 @@ func (z *FileInfo) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "Data")
return
}
if z.Data == nil {
z.Data = make([]byte, 0)
}
}
z.NumVersions, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
@ -2937,6 +2964,9 @@ func (z *FileInfo) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "Checksum")
return
}
if z.Checksum == nil {
z.Checksum = make([]byte, 0)
}
}
z.Versioned, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
@ -3961,6 +3991,9 @@ func (z *RawFileInfo) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "Buf")
return
}
if z.Buf == nil {
z.Buf = make([]byte, 0)
}
}
default:
err = dc.Skip()
@ -4038,6 +4071,9 @@ func (z *RawFileInfo) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "Buf")
return
}
if z.Buf == nil {
z.Buf = make([]byte, 0)
}
}
default:
bts, err = msgp.Skip(bts)
@ -4220,6 +4256,8 @@ func (z *ReadMultipleReq) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -4240,6 +4278,7 @@ func (z *ReadMultipleReq) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "Prefix")
return
}
zb0001Mask |= 0x1
case "fl":
var zb0002 uint32
zb0002, err = dc.ReadArrayHeader()
@ -4291,6 +4330,12 @@ func (z *ReadMultipleReq) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.Prefix = ""
}
}
return
}
@ -4449,6 +4494,8 @@ func (z *ReadMultipleReq) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -4469,6 +4516,7 @@ func (z *ReadMultipleReq) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "Prefix")
return
}
zb0001Mask |= 0x1
case "fl":
var zb0002 uint32
zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
@ -4520,6 +4568,12 @@ func (z *ReadMultipleReq) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.Prefix = ""
}
}
o = bts
return
}
@ -4544,6 +4598,8 @@ func (z *ReadMultipleResp) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 2 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -4564,6 +4620,7 @@ func (z *ReadMultipleResp) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "Prefix")
return
}
zb0001Mask |= 0x1
case "fl":
z.File, err = dc.ReadString()
if err != nil {
@ -4582,6 +4639,7 @@ func (z *ReadMultipleResp) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "Error")
return
}
zb0001Mask |= 0x2
case "d":
z.Data, err = dc.ReadBytes(z.Data)
if err != nil {
@ -4602,6 +4660,15 @@ func (z *ReadMultipleResp) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x3 {
if (zb0001Mask & 0x1) == 0 {
z.Prefix = ""
}
if (zb0001Mask & 0x2) == 0 {
z.Error = ""
}
}
return
}
@ -4762,6 +4829,8 @@ func (z *ReadMultipleResp) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 2 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -4782,6 +4851,7 @@ func (z *ReadMultipleResp) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "Prefix")
return
}
zb0001Mask |= 0x1
case "fl":
z.File, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
@ -4800,6 +4870,7 @@ func (z *ReadMultipleResp) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "Error")
return
}
zb0001Mask |= 0x2
case "d":
z.Data, bts, err = msgp.ReadBytesBytes(bts, z.Data)
if err != nil {
@ -4820,6 +4891,15 @@ func (z *ReadMultipleResp) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x3 {
if (zb0001Mask & 0x1) == 0 {
z.Prefix = ""
}
if (zb0001Mask & 0x2) == 0 {
z.Error = ""
}
}
o = bts
return
}

View File

@ -55,6 +55,8 @@ func isXLMetaErasureInfoValid(data, parity int) bool {
return ((data >= parity) && (data > 0) && (parity >= 0))
}
//msgp:clearomitted
//go:generate msgp -file=$GOFILE -unexported
// A xlMetaV1Object represents `xl.meta` metadata header.

View File

@ -561,6 +561,8 @@ func (z *ObjectPartInfo) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 3 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -605,6 +607,7 @@ func (z *ObjectPartInfo) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err, "Index")
return
}
zb0001Mask |= 0x1
case "crc":
var zb0002 uint32
zb0002, err = dc.ReadMapHeader()
@ -635,12 +638,14 @@ func (z *ObjectPartInfo) DecodeMsg(dc *msgp.Reader) (err error) {
}
z.Checksums[za0001] = za0002
}
zb0001Mask |= 0x2
case "err":
z.Error, err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "Error")
return
}
zb0001Mask |= 0x4
default:
err = dc.Skip()
if err != nil {
@ -649,6 +654,18 @@ func (z *ObjectPartInfo) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x7 {
if (zb0001Mask & 0x1) == 0 {
z.Index = nil
}
if (zb0001Mask & 0x2) == 0 {
z.Checksums = nil
}
if (zb0001Mask & 0x4) == 0 {
z.Error = ""
}
}
return
}
@ -850,6 +867,8 @@ func (z *ObjectPartInfo) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 3 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -894,6 +913,7 @@ func (z *ObjectPartInfo) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "Index")
return
}
zb0001Mask |= 0x1
case "crc":
var zb0002 uint32
zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
@ -924,12 +944,14 @@ func (z *ObjectPartInfo) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
z.Checksums[za0001] = za0002
}
zb0001Mask |= 0x2
case "err":
z.Error, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Error")
return
}
zb0001Mask |= 0x4
default:
bts, err = msgp.Skip(bts)
if err != nil {
@ -938,6 +960,18 @@ func (z *ObjectPartInfo) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x7 {
if (zb0001Mask & 0x1) == 0 {
z.Index = nil
}
if (zb0001Mask & 0x2) == 0 {
z.Checksums = nil
}
if (zb0001Mask & 0x4) == 0 {
z.Error = ""
}
}
o = bts
return
}

View File

@ -47,6 +47,8 @@ var (
xlVersionCurrent [4]byte
)
//msgp:clearomitted
//go:generate msgp -file=$GOFILE -unexported
//go:generate stringer -type VersionType,ErasureAlgo -output=xl-storage-format-v2_string.go $GOFILE

View File

@ -276,6 +276,8 @@ func (z *xlMetaDataDirDecoder) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -327,6 +329,7 @@ func (z *xlMetaDataDirDecoder) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
zb0001Mask |= 0x1
default:
err = dc.Skip()
if err != nil {
@ -335,6 +338,12 @@ func (z *xlMetaDataDirDecoder) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.ObjectV2 = nil
}
}
return
}
@ -425,6 +434,8 @@ func (z *xlMetaDataDirDecoder) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -475,6 +486,7 @@ func (z *xlMetaDataDirDecoder) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
zb0001Mask |= 0x1
default:
bts, err = msgp.Skip(bts)
if err != nil {
@ -483,6 +495,12 @@ func (z *xlMetaDataDirDecoder) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.ObjectV2 = nil
}
}
o = bts
return
}
@ -508,6 +526,8 @@ func (z *xlMetaV2DeleteMarker) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -558,6 +578,7 @@ func (z *xlMetaV2DeleteMarker) DecodeMsg(dc *msgp.Reader) (err error) {
}
z.MetaSys[za0002] = za0003
}
zb0001Mask |= 0x1
default:
err = dc.Skip()
if err != nil {
@ -566,6 +587,12 @@ func (z *xlMetaV2DeleteMarker) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.MetaSys = nil
}
}
return
}
@ -678,6 +705,8 @@ func (z *xlMetaV2DeleteMarker) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -728,6 +757,7 @@ func (z *xlMetaV2DeleteMarker) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
z.MetaSys[za0002] = za0003
}
zb0001Mask |= 0x1
default:
bts, err = msgp.Skip(bts)
if err != nil {
@ -736,6 +766,12 @@ func (z *xlMetaV2DeleteMarker) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.MetaSys = nil
}
}
o = bts
return
}
@ -762,6 +798,8 @@ func (z *xlMetaV2Object) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -958,6 +996,7 @@ func (z *xlMetaV2Object) DecodeMsg(dc *msgp.Reader) (err error) {
return
}
}
zb0001Mask |= 0x1
case "Size":
z.Size, err = dc.ReadInt64()
if err != nil {
@ -1056,6 +1095,12 @@ func (z *xlMetaV2Object) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.PartIndices = nil
}
}
return
}
@ -1483,6 +1528,8 @@ func (z *xlMetaV2Object) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 1 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -1671,6 +1718,7 @@ func (z *xlMetaV2Object) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
}
zb0001Mask |= 0x1
case "Size":
z.Size, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
@ -1761,6 +1809,12 @@ func (z *xlMetaV2Object) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x1 {
if (zb0001Mask & 0x1) == 0 {
z.PartIndices = nil
}
}
o = bts
return
}
@ -1802,6 +1856,8 @@ func (z *xlMetaV2Version) DecodeMsg(dc *msgp.Reader) (err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 3 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
@ -1838,6 +1894,7 @@ func (z *xlMetaV2Version) DecodeMsg(dc *msgp.Reader) (err error) {
return
}
}
zb0001Mask |= 0x1
case "V2Obj":
if dc.IsNil() {
err = dc.ReadNil()
@ -1856,6 +1913,7 @@ func (z *xlMetaV2Version) DecodeMsg(dc *msgp.Reader) (err error) {
return
}
}
zb0001Mask |= 0x2
case "DelObj":
if dc.IsNil() {
err = dc.ReadNil()
@ -1874,6 +1932,7 @@ func (z *xlMetaV2Version) DecodeMsg(dc *msgp.Reader) (err error) {
return
}
}
zb0001Mask |= 0x4
case "v":
z.WrittenByVersion, err = dc.ReadUint64()
if err != nil {
@ -1888,6 +1947,18 @@ func (z *xlMetaV2Version) DecodeMsg(dc *msgp.Reader) (err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x7 {
if (zb0001Mask & 0x1) == 0 {
z.ObjectV1 = nil
}
if (zb0001Mask & 0x2) == 0 {
z.ObjectV2 = nil
}
if (zb0001Mask & 0x4) == 0 {
z.DeleteMarker = nil
}
}
return
}
@ -2079,6 +2150,8 @@ func (z *xlMetaV2Version) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 3 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
@ -2114,6 +2187,7 @@ func (z *xlMetaV2Version) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
}
zb0001Mask |= 0x1
case "V2Obj":
if msgp.IsNil(bts) {
bts, err = msgp.ReadNilBytes(bts)
@ -2131,6 +2205,7 @@ func (z *xlMetaV2Version) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
}
zb0001Mask |= 0x2
case "DelObj":
if msgp.IsNil(bts) {
bts, err = msgp.ReadNilBytes(bts)
@ -2148,6 +2223,7 @@ func (z *xlMetaV2Version) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
}
zb0001Mask |= 0x4
case "v":
z.WrittenByVersion, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
@ -2162,6 +2238,18 @@ func (z *xlMetaV2Version) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x7 {
if (zb0001Mask & 0x1) == 0 {
z.ObjectV1 = nil
}
if (zb0001Mask & 0x2) == 0 {
z.ObjectV2 = nil
}
if (zb0001Mask & 0x4) == 0 {
z.DeleteMarker = nil
}
}
o = bts
return
}

2
go.mod
View File

@ -79,7 +79,7 @@ require (
github.com/rs/cors v1.11.1
github.com/secure-io/sio-go v0.3.1
github.com/shirou/gopsutil/v3 v3.24.5
github.com/tinylib/msgp v1.2.2
github.com/tinylib/msgp v1.2.3-0.20241022140105-4558fbf3a223
github.com/valyala/bytebufferpool v1.0.0
github.com/xdg/scram v1.0.5
github.com/zeebo/xxh3 v1.0.2

4
go.sum
View File

@ -597,8 +597,8 @@ github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JT
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tinylib/msgp v1.2.2 h1:iHiBE1tJQwFI740SPEPkGE8cfhNfrqOYRlH450BnC/4=
github.com/tinylib/msgp v1.2.2/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0=
github.com/tinylib/msgp v1.2.3-0.20241022140105-4558fbf3a223 h1:3k5ahk009QcaghR2H5bO4iaRHMs5P56x6g5wXB/OKcQ=
github.com/tinylib/msgp v1.2.3-0.20241022140105-4558fbf3a223/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0=
github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU=
github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY=
github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY=