Created
March 28, 2018 19:59
-
-
Save tychoish/a7eff806f3200b687a18b1c14faef2b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type nopCloser struct { | |
io.Reader | |
} | |
func (nopCloser) Close() error { return nil } | |
// NopCloser returns a ReadCloser with a no-op Close method wrapping | |
// the provided Reader r. | |
func NopCloser(r io.Reader) io.ReadCloser { | |
return nopCloser{r} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment