extrame / xls

Pure Golang xls library
Apache License 2.0
331 stars 210 forks source link

Make xls.parse a public method #5

Closed JamesHenry closed 8 years ago

JamesHenry commented 8 years ago

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!

extrame commented 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.

JamesHenry commented 8 years ago

Ok, if your implementation details are going to change it makes sense to not expose it.

Thanks!

JamesHenry commented 8 years ago

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()