Skip to content

Custom format Option #46

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

Closed
lmittmann opened this issue Jul 1, 2024 · 4 comments
Closed

Custom format Option #46

lmittmann opened this issue Jul 1, 2024 · 4 comments

Comments

@lmittmann
Copy link

How can I handle a custom format option in an UnmarshalerV2?

@dsnet
Copy link
Collaborator

dsnet commented Jul 1, 2024

The intention of this feature was for it to be user-customizable. However, there are some gnarly questions regarding whether the format option is applicable to exactly the current value in the tree or the entire sub-tree. This is something that we can figure out after the initial release of v2.

You can watch our discussion on the topic at https://www.youtube.com/watch?v=sgWVtViFkBs&t=2668s.

@lmittmann
Copy link
Author

IMO the greatest v2 feature is the possibility to overwrite the (un)marshalling logic of types one does not control. But when one type can have more than one marshaling logic I need to fall back to type proxies again, like with v1.

From my understanding of the discussion you want that the format option only applies to "leaf"-keys. Is there already an existing prototype implementation of this?

@dsnet
Copy link
Collaborator

dsnet commented Dec 13, 2024

Closing. The initial release of this module will not support custom formats, but we can consider it as a separate proposal within the main golang/go repo when this work lands in the stdlib.

@dsnet dsnet closed this as completed Dec 13, 2024
@dsnet
Copy link
Collaborator

dsnet commented Jan 29, 2025

You may be interested in #138. We're not currently planning on adding this to the initial release of v2, but it is worth filing as a follow-up proposal.

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