Closed flowchartsman closed 9 years ago
Is it that hard to use the code from the example, using the basic Unmarshal
function, and not to bloat the public API? Also, some people might want to open the file in a different way.
More comments:
s/UnmarshallFile/Unmarshalfile
UnmarshalFile ...
.Is it hard? Absolutely not. As I say, it's just a convenience method.
I absolutely agree that people might want to open the file a different way, but I'd wager the majority of use cases will just be opening a text file on disk.
That said, it's your library, you're completely free to reject this pull request outright, or reject it and implement it yourself, and it would cause me no hard feelings whatsoever. I'll go ahead and push the changes you suggest, and you can do what you think is best!
I added Encoder
and Decoder
like encoding/json
. You can use these APIs.
I think it is good enough.
Works for me!
Hey @alaska, this is not my library, just a humble user giving some feedback to your PR ☺️
Glad that you came up with a workaround!
If the most common use case is to read in the file and parse it, seems like a convenience method is a good idea.