go-zero/core/iox/nopcloser.go
2021-02-19 18:40:26 +08:00

17 lines
254 B
Go

package iox
import "io"
type nopCloser struct {
io.Writer
}
func (nopCloser) Close() error {
return nil
}
// NopCloser returns a io.WriteCloser that does nothing on calling Close.
func NopCloser(w io.Writer) io.WriteCloser {
return nopCloser{w}
}