can add CloserFunc and WriterAndCloser
CloserFunc is:
type CloserFunc func() error
func (fn CloserFunc) Close() error {
return fn()
}
var _ io.Closer = CloserFunc(func() error {})
WriterAndCloser is:
type writeCloser struct {
io.Writer
io.Closer
}
func WriterAndCloser(w io.Writer, c io.Closer) io.WriteCloser {
return writeCloser{
Writer: w,
Closer: c,
}
}
see: https://github.com/search?q=CloserFunc+language%3Ago&type=code
can add CloserFunc and WriterAndCloser
CloserFunc is:
WriterAndCloser is:
see: https://github.com/search?q=CloserFunc+language%3Ago&type=code