Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Export getCSVRows and readTo #49

Open
sidazhang opened this issue Oct 8, 2016 · 3 comments
Open

[feature request] Export getCSVRows and readTo #49

sidazhang opened this issue Oct 8, 2016 · 3 comments

Comments

@sidazhang
Copy link

I have a use case where I already have the csv rows in memory as [][]string. So I no longer need to parse strings.

And primarily I would like to be able to implement a custom decoder and leverage the readTo function to populate fields into the my structs.

@pikanezi
Copy link
Member

pikanezi commented Oct 8, 2016

Hello,

If I understood well, you would like func readTo(decoder Decoder, out interface{}) error to be public?

@sidazhang
Copy link
Author

@pikanezi Yes that's right.

I believe that there are two things that need to be made public:

type Decoder interface {
    getCSVRows() ([][]string, error) // This method is currently private
}

func readTo(decoder Decoder, out interface{}) error // Making this function public

I can submit a pull request but I want to make sure that you are happy with the change and if you are happy with it, I want to collect feedbacks on how you would like to interface to look like before starting work on it

@pikanezi
Copy link
Member

Sorry for the delay @sidazhang .

I don't see any problems for making these two things public.
As for the interface, does it need to change? Just making the method
getCSVRows() ([][]string, error) public is not enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants