_, ok := r.(WriterTo) // NopCloser returns a ReadCloser with a no-op Close method wrapping // the provided Reader r. // If r implements WriterTo, the returned ReadCloser will implement WriterTo // by forwarding calls to r. func NopCloser(r Reader) ReadCloser { if _, ok := r.(WriterTo); ok { return nopCloserWriterTo{r} } return nopCloser{r} }
翻译
搜索
复制
标签:NopCloser,ok,ReadCloser,Reader,return,WriterTo From: https://www.cnblogs.com/papering/p/17497564.html