Golang io/ioutil NopCloser
Whenever you need to return an io.ReadCloser, while making sure a Close() is available, you can use a NopCloser to build such a ReaderCloser. You can see one example in this fork of gorest, in util.go //Marshals the data in interface i into a byte slice, using the Marhaller/Unmarshaller specified in mime. //The Marhaller/Unmarshaller must … Read more