diff options
author | 2024-09-26 19:50:08 +0000 | |
---|---|---|
committer | 2024-09-26 19:50:08 +0000 | |
commit | 58af95a1d5e24950c0a1ab4389289ca70f594ba2 (patch) | |
tree | 8709fd97a5641fc070a91f7c7852908971d6bde2 /vendor/codeberg.org/gruf/go-byteutil/reader.go | |
parent | [chore] update go-sched pkg (#3357) (diff) | |
download | gotosocial-58af95a1d5e24950c0a1ab4389289ca70f594ba2.tar.xz |
[chore] bump go-byteutil v1.2.0 -> v1.3.0 (#3356)
* bump go-byteutil v1.2.0 -> v1.3.0 which has safer (as in long-term API consistency) byte <-> string conversions
* fix test relying on byteutil exported type no longer existing
Diffstat (limited to 'vendor/codeberg.org/gruf/go-byteutil/reader.go')
-rw-r--r-- | vendor/codeberg.org/gruf/go-byteutil/reader.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/codeberg.org/gruf/go-byteutil/reader.go b/vendor/codeberg.org/gruf/go-byteutil/reader.go deleted file mode 100644 index 94c755ff4..000000000 --- a/vendor/codeberg.org/gruf/go-byteutil/reader.go +++ /dev/null @@ -1,36 +0,0 @@ -package byteutil - -import "bytes" - -// Reader wraps a bytes.Reader{} to provide Rewind() capabilities. -type Reader struct { - B []byte - bytes.Reader -} - -// NewReader returns a new Reader{} instance reset to b. -func NewReader(b []byte) *Reader { - r := &Reader{} - r.Reset(b) - return r -} - -// Reset resets the Reader{} to be reading from b and sets Reader{}.B. -func (r *Reader) Reset(b []byte) { - r.B = b - r.Rewind() -} - -// Rewind resets the Reader{} to be reading from the start of Reader{}.B. -func (r *Reader) Rewind() { - r.Reader.Reset(r.B) -} - -// ReadNopCloser wraps a Reader{} to provide nop close method. -type ReadNopCloser struct { - Reader -} - -func (*ReadNopCloser) Close() error { - return nil -} |