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

[question] Why can't Encoder check and call fmt.Stringer.String() on element automatically? #196

Open
howellzhu opened this issue Dec 1, 2022 · 0 comments
Labels

Comments

@howellzhu
Copy link

howellzhu commented Dec 1, 2022

Why can't Encoder directly determine whether an element implements an interface (such as fmt.Stringer or encoding.TextMarshaler) and actively call its interface to implement Encode()?

After all, Decode already does that (using encoding.TextUnmrshaler interface).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant