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

add support for fields that satisfy encoding.TextUnmarshaler #6

Merged
merged 3 commits into from
Mar 1, 2016

Conversation

nsaje
Copy link
Contributor

@nsaje nsaje commented Feb 26, 2016

This adds support for fields that satisfy TextUnmarshaler interface. This allows defining custom data structures, example here https://github.com/BurntSushi/toml#using-the-encodingtextunmarshaler-interface

}

func (s *validTextUnmarshaler) UnmarshalText(text []byte) error {
s.DummyFloat = 1.0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nsaje here you only test if this method is called. Would you mind changing what this method does (and the corresponding tests you wrote), so we'll also test that the correct value get's passed to UnmarshalText?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tomazk
Copy link
Owner

tomazk commented Mar 1, 2016

@nsaje thank you so much for this PR! I'll definitely merge this.

Before I do so .. I added one small comment above. Let me know if it makes sense to you.

@nsaje
Copy link
Contributor Author

nsaje commented Mar 1, 2016

Is this what you had in mind? 😄

@tomazk
Copy link
Owner

tomazk commented Mar 1, 2016

@nsaje Perfect!

Thanks again 🤘

tomazk added a commit that referenced this pull request Mar 1, 2016
add support for fields that satisfy encoding.TextUnmarshaler
@tomazk tomazk merged commit 75f014c into tomazk:master Mar 1, 2016
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

Successfully merging this pull request may close these issues.

2 participants