Created
December 1, 2018 00:58
-
-
Save jdoliner/777b223e08f4daa4bb69952a6072037d 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
func NewReadCloser(r io.Reader) ReadCloser { | |
if rc, ok := r.(io.ReadCloser) { | |
return ReadCloser{rc} | |
} else { | |
return NopReadCloser{r} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment