amuz.es/src/infra/goutils@v0.1.3/io/writer.go (about)

     1  package io
     2  
     3  import (
     4  	"io"
     5  )
     6  
     7  type nopWriter struct {
     8  	io.Writer
     9  }
    10  
    11  func (nopWriter) Close() error { return nil }
    12  
    13  // NopCloser returns a ReadCloser with a no-op Close method wrapping
    14  // the provided Reader r.
    15  func NopCloser(w io.Writer) io.WriteCloser {
    16  	return nopWriter{w}
    17  }