-
Notifications
You must be signed in to change notification settings - Fork 14
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
document and add example using unmarshaler interface #41
Conversation
Ideas welcome for a simpler example. |
example_unmarshaler_test.go
Outdated
// Example_unmarshaler demonstrates using structs that use the Unmarshaler interface. | ||
func Example_unmarshaler() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is renamed ExampleUnmarshaler, it will be come an example on the interface instead of a package-level example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. That was my goal! I tried to find examples and docs of how to do that, but came up empty. Was that documented somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This blog post is what I was going off of: https://go.dev/blog/examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's what I read. I guess I didn't extend the function naming from the non-whole file example to the whole-file in my head. 🤷 Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though you might consider changing the example function name.
Resolves #14.