26 lines
465 B
Go
26 lines
465 B
Go
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
|
|
|
package ext
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
// Restrict the underlying io.Reader to only exposed the io.Reader interface.
|
|
// Removes the io.WriterTo interface.
|
|
func NewReadCloser(r io.ReadCloser) io.ReadCloser {
|
|
return basicReadCloser{r}
|
|
}
|
|
|
|
type basicReadCloser struct {
|
|
io.ReadCloser
|
|
}
|
|
|
|
func NewReader(r io.Reader) io.Reader {
|
|
return basicReader{r}
|
|
}
|
|
|
|
type basicReader struct {
|
|
io.Reader
|
|
}
|