summaryrefslogtreecommitdiff
path: root/vendor/github.com/minio/minio-go/v7/hook-reader.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-04-28 11:20:24 +0000
committerLibravatar kim <gruf@noreply.codeberg.org>2025-04-28 11:20:24 +0000
commit436765a6a2ddf400b6e06c9a7c3283b1351fcbcd (patch)
treec1a0e969c23a74eaca258c709db1776763d576dd /vendor/github.com/minio/minio-go/v7/hook-reader.go
parent[chore] Update build to use new woodpecker dind container, bump version numbe... (diff)
downloadgotosocial-436765a6a2ddf400b6e06c9a7c3283b1351fcbcd.tar.xz
bump dependencies: minio-go, go-sqlite3, goldmark, otel, x/image/webp (#4075)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4075 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/hook-reader.go')
-rw-r--r--vendor/github.com/minio/minio-go/v7/hook-reader.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/hook-reader.go b/vendor/github.com/minio/minio-go/v7/hook-reader.go
index 07bc7dbcf..61268a104 100644
--- a/vendor/github.com/minio/minio-go/v7/hook-reader.go
+++ b/vendor/github.com/minio/minio-go/v7/hook-reader.go
@@ -20,7 +20,6 @@ package minio
import (
"fmt"
"io"
- "sync"
)
// hookReader hooks additional reader in the source stream. It is
@@ -28,7 +27,6 @@ import (
// notified about the exact number of bytes read from the primary
// source on each Read operation.
type hookReader struct {
- mu sync.RWMutex
source io.Reader
hook io.Reader
}
@@ -36,9 +34,6 @@ type hookReader struct {
// Seek implements io.Seeker. Seeks source first, and if necessary
// seeks hook if Seek method is appropriately found.
func (hr *hookReader) Seek(offset int64, whence int) (n int64, err error) {
- hr.mu.Lock()
- defer hr.mu.Unlock()
-
// Verify for source has embedded Seeker, use it.
sourceSeeker, ok := hr.source.(io.Seeker)
if ok {
@@ -70,9 +65,6 @@ func (hr *hookReader) Seek(offset int64, whence int) (n int64, err error) {
// value 'n' number of bytes are reported through the hook. Returns
// error for all non io.EOF conditions.
func (hr *hookReader) Read(b []byte) (n int, err error) {
- hr.mu.RLock()
- defer hr.mu.RUnlock()
-
n, err = hr.source.Read(b)
if err != nil && err != io.EOF {
return n, err
@@ -92,7 +84,7 @@ func (hr *hookReader) Read(b []byte) (n int, err error) {
// reports the data read from the source to the hook.
func newHook(source, hook io.Reader) io.Reader {
if hook == nil {
- return &hookReader{source: source}
+ return source
}
return &hookReader{
source: source,