summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-iotools/read.go
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2025-03-09 17:47:56 +0100
committerLibravatar Terin Stock <terinjokes@gmail.com>2025-03-10 01:59:49 +0100
commit3ac1ee16f377d31a0fb80c8dae28b6239ac4229e (patch)
treef61faa581feaaeaba2542b9f2b8234a590684413 /vendor/codeberg.org/gruf/go-iotools/read.go
parent[chore] update URLs to forked source (diff)
downloadgotosocial-3ac1ee16f377d31a0fb80c8dae28b6239ac4229e.tar.xz
[chore] remove vendor
Diffstat (limited to 'vendor/codeberg.org/gruf/go-iotools/read.go')
-rw-r--r--vendor/codeberg.org/gruf/go-iotools/read.go41
1 files changed, 0 insertions, 41 deletions
diff --git a/vendor/codeberg.org/gruf/go-iotools/read.go b/vendor/codeberg.org/gruf/go-iotools/read.go
deleted file mode 100644
index 13c5e21ac..000000000
--- a/vendor/codeberg.org/gruf/go-iotools/read.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package iotools
-
-import (
- "io"
-)
-
-// ReadCloserType implements io.ReadCloser
-// by combining the two underlying interfaces,
-// while providing an exported type to still
-// access the underlying original io.Reader or
-// io.Closer separately (e.g. without wrapping).
-type ReadCloserType struct {
- io.Reader
- io.Closer
-}
-
-// ReaderFunc is a function signature which allows
-// a function to implement the io.Reader type.
-type ReaderFunc func([]byte) (int, error)
-
-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 &ReadCloserType{r, c}
-}
-
-// NopReadCloser wraps io.Reader with NopCloser{} in ReadCloserType.
-func NopReadCloser(r io.Reader) io.ReadCloser {
- return &ReadCloserType{r, NopCloser{}}
-}