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

Decode: unstable/Unmarshal interface #940

Merged
merged 4 commits into from
Mar 19, 2024

Conversation

rszyma
Copy link
Contributor

@rszyma rszyma commented Mar 14, 2024

This adds the Unmarshaler interface to the v2 package. This way types that implement this interface can define the way they are unmarshalled.

Attempts to fix #873
Supersedes #921

@rszyma
Copy link
Contributor Author

rszyma commented Mar 14, 2024

there are still arrays and tables left to be implemented properly

@pelletier
Copy link
Owner

Thank you for pushing this! Sorry, it took me a while to review.

I've confirmed there is no performance regression when the feature is disabled (by default), as expected. I'll push a commit on this branch to warn people of the state of the feature and it should be good to be merged.

@pelletier pelletier changed the title feat(unmarshaler): add support for fields to unmarshal themselves Decode: unstable/Unmarshal interface Mar 19, 2024
@pelletier pelletier added the feature Issue asking for a new feature in go-toml. label Mar 19, 2024
@pelletier pelletier merged commit 8ed6d13 into pelletier:v2 Mar 19, 2024
11 checks passed
@rszyma rszyma deleted the 873-add-unmarshaler-interface branch March 19, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issue asking for a new feature in go-toml.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bring back toml.Unmarshaler
3 participants