github.com/shuguocloud/go-zero@v1.3.0/core/iox/nopcloser.go (about)

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