nopcloser.go 254 B

12345678910111213141516
  1. package iox
  2. import "io"
  3. type nopCloser struct {
  4. io.Writer
  5. }
  6. func (nopCloser) Close() error {
  7. return nil
  8. }
  9. // NopCloser returns a io.WriteCloser that does nothing on calling Close.
  10. func NopCloser(w io.Writer) io.WriteCloser {
  11. return nopCloser{w}
  12. }