[chore]: Bump github.com/minio/minio-go/v7 from 7.0.53 to 7.0.55 (#1844)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2023-05-29 13:47:11 +01:00 committed by GitHub
commit 9ed96bc570
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 4137 additions and 3218 deletions

View file

@ -288,10 +288,35 @@ func (z *Reader) Read(p []byte) (n int, err error) {
return n, nil
}
// Support the io.WriteTo interface for io.Copy and friends.
type crcer interface {
io.Writer
Sum32() uint32
Reset()
}
type crcUpdater struct {
z *Reader
}
func (c *crcUpdater) Write(p []byte) (int, error) {
c.z.digest = crc32.Update(c.z.digest, crc32.IEEETable, p)
return len(p), nil
}
func (c *crcUpdater) Sum32() uint32 {
return c.z.digest
}
func (c *crcUpdater) Reset() {
c.z.digest = 0
}
// WriteTo support the io.WriteTo interface for io.Copy and friends.
func (z *Reader) WriteTo(w io.Writer) (int64, error) {
total := int64(0)
crcWriter := crc32.NewIEEE()
crcWriter := crcer(crc32.NewIEEE())
if z.digest != 0 {
crcWriter = &crcUpdater{z: z}
}
for {
if z.err != nil {
if z.err == io.EOF {