go.rice
go.rice copied to clipboard
Implement io.ReaderAt for File
If I add a zip file, and want to unzip it, the zip.NewReader takes a io.ReaderAt.
There is a workaround: I ask for the bytes of the file from rice and then create bytes.NewReader
fileBytes, err := box.Bytes("filename")
if err != nil {
panic(err)
}
zr, err := zip.NewReader(bytes.NewReader(fileBytes), int64(len(fileBytes)))
...
But it would be great if I can use just rice.File for this.