diff options
| author | 2023-10-31 11:12:22 +0000 | |
|---|---|---|
| committer | 2023-10-31 11:12:22 +0000 | |
| commit | ce71a5a7902963538fc54583588850563f6746cc (patch) | |
| tree | 3e869eba6d25d2db5fe81184ffee595e451b3147 /vendor/codeberg.org/gruf/go-iotools/write.go | |
| parent | [bugfix] Relax `Mention` parsing, allowing either href or name (#2320) (diff) | |
| download | gotosocial-ce71a5a7902963538fc54583588850563f6746cc.tar.xz | |
[feature] add per-uri dereferencer locks (#2291)
Diffstat (limited to 'vendor/codeberg.org/gruf/go-iotools/write.go')
| -rw-r--r-- | vendor/codeberg.org/gruf/go-iotools/write.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vendor/codeberg.org/gruf/go-iotools/write.go b/vendor/codeberg.org/gruf/go-iotools/write.go index c520b8636..e1b44db24 100644 --- a/vendor/codeberg.org/gruf/go-iotools/write.go +++ b/vendor/codeberg.org/gruf/go-iotools/write.go @@ -10,6 +10,14 @@ func (w WriterFunc) Write(b []byte) (int, error) { return w(b) } +// WriterToFunc is a function signature which allows +// a function to implement the io.WriterTo type. +type WriterToFunc func(io.Writer) (int64, error) + +func (wt WriterToFunc) WriteTo(r io.Writer) (int64, error) { + return wt(r) +} + // WriteCloser wraps an io.Writer and io.Closer in order to implement io.WriteCloser. func WriteCloser(w io.Writer, c io.Closer) io.WriteCloser { return &struct { |
