Skip to content

Decode: unstable/Unmarshal interface#940

Merged
pelletier merged 4 commits intopelletier:v2from
rszyma:873-add-unmarshaler-interface
Mar 19, 2024
Merged

Decode: unstable/Unmarshal interface#940
pelletier merged 4 commits intopelletier:v2from
rszyma:873-add-unmarshaler-interface

Conversation

@rszyma
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

rszyma commented Mar 14, 2024

there are still arrays and tables left to be implemented properly

@pelletier
Copy link
Copy Markdown
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
@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