I'm interested in using statik for a non-HTTP-serving use case, and one thing that'd make it a bit easier is if I could get a fresh bytes.Reader on the file:
// NewReader returns a new bytes.Reader reading from f.
func (f *httpFile) NewReader() *bytes.Reader {
return bytes.NewReader(f.data)
}
The reason is because I need to use the file with something that wants an io.ReaderAt. I opted to use io.ReadFull, but that takes a copy of the underlying bytes which I'd like to avoid.
I'm interested in using statik for a non-HTTP-serving use case, and one thing that'd make it a bit easier is if I could get a fresh bytes.Reader on the file:
The reason is because I need to use the file with something that wants an io.ReaderAt. I opted to use io.ReadFull, but that takes a copy of the underlying bytes which I'd like to avoid.