Closed JamesHenry closed 8 years ago
I suggest to use xls.OpenReader(bytes.NewReader(bytes),"utf-8").
It is because the parse function is scheduled to be orverwrited by using reader instead, so I suggest you to use reader too.
Ok, if your implementation details are going to change it makes sense to not expose it.
Thanks!
P.S. Just in case anyone else references this in the future:
Your example would give the following error *bytes.Reader does not implement io.ReadCloser (missing Close method)
You can solve this by wrapping the call to bytes.NewReader
in a ioutil.NopCloser()
Would you be open to a PR to make parse a public method: https://github.com/extrame/xls/blob/master/xls.go#L28?
I want to use this package to add xls support to a tool I have made. It already supports multiple file type parsing via a function which receives a slice of bytes, so being able use xls.parse directly would be very useful.
Many thanks!