infra
/
goutils
Archived
1
0
Fork 0
This repository has been archived on 2022-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
goutils/io/writer.go

18 lines
278 B
Go

package io
import (
"io"
)
type nopWriter struct {
io.Writer
}
func (nopWriter) Close() error { return nil }
// NopCloser returns a ReadCloser with a no-op Close method wrapping
// the provided Reader r.
func NopCloser(w io.Writer) io.WriteCloser {
return nopWriter{w}
}