Golang io/ioutil NopCloser

后端 未结 2 1817
时光说笑
时光说笑 2020-12-30 23:44

Does anyone have a good or any explanation of Golang\'s NopCloser function?
I looked around but failed to find anything besides Golang\'s main doc\'s explanation of:

2条回答
  •  伪装坚强ぢ
    2020-12-31 00:43

    It's used for functions that require io.ReadCloser but your current object (for example a bytes.Buffer) doesn't provide a Close function.

提交回复
热议问题