From ce71a5a7902963538fc54583588850563f6746cc Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:12:22 +0000 Subject: [feature] add per-uri dereferencer locks (#2291) --- vendor/codeberg.org/gruf/go-iotools/read.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vendor/codeberg.org/gruf/go-iotools/read.go') diff --git a/vendor/codeberg.org/gruf/go-iotools/read.go b/vendor/codeberg.org/gruf/go-iotools/read.go index 4a134e7b3..6ce2789a7 100644 --- a/vendor/codeberg.org/gruf/go-iotools/read.go +++ b/vendor/codeberg.org/gruf/go-iotools/read.go @@ -12,6 +12,14 @@ func (r ReaderFunc) Read(b []byte) (int, error) { return r(b) } +// ReaderFromFunc is a function signature which allows +// a function to implement the io.ReaderFrom type. +type ReaderFromFunc func(io.Reader) (int64, error) + +func (rf ReaderFromFunc) ReadFrom(r io.Reader) (int64, error) { + return rf(r) +} + // ReadCloser wraps an io.Reader and io.Closer in order to implement io.ReadCloser. func ReadCloser(r io.Reader, c io.Closer) io.ReadCloser { return &struct { -- cgit v1.2.3