go-zero/core/iox/nopcloser.go

17 lines
255 B
Go
Raw Normal View History

2020-07-26 17:09:05 +08:00
package iox
import "io"
type nopCloser struct {
io.Writer
}
func (nopCloser) Close() error {
return nil
}
2022-11-04 21:55:17 +08:00
// NopCloser returns an io.WriteCloser that does nothing on calling Close.
2020-07-26 17:09:05 +08:00
func NopCloser(w io.Writer) io.WriteCloser {
return nopCloser{w}
}