Skip to content

feat: dynamic comments and MarshalToml interface implementation#1014

Open
someshkoli wants to merge 12 commits intopelletier:v2from
someshkoli:ft-dynamic-comments
Open

feat: dynamic comments and MarshalToml interface implementation#1014
someshkoli wants to merge 12 commits intopelletier:v2from
someshkoli:ft-dynamic-comments

Conversation

@someshkoli
Copy link
Copy Markdown

@someshkoli someshkoli commented Dec 23, 2025

This pr was primarily inspired by the need to have dynamic comments, I noticed that we had dropped the plan for dynamic comments from v2 . While writing this, came across case where MarshalToml wouldve been very handy similar to MarshalJSON so the pr contains that as well.

End results can be found in test cases written.

We introduce func TomlComment() string interface and func MarshalToml() ([]byte, error) interface to achieve both the things.

Open to inputs and improvements so we can land this 🚀


Paste benchstat results here

Copy link
Copy Markdown

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 some suggestions anyway

@someshkoli
Copy link
Copy Markdown
Author

LGTM 👍 some suggestions anyway

resolved 🙌

@pelletier
Copy link
Copy Markdown
Owner

Hi! Thank you for looking at this. Seems like tests are failing. After fixing them, can you paste benchstat results please? I'd love to see the impact of the interface implementation checks.

@pelletier pelletier added the feature Issue asking for a new feature in go-toml. label Jan 4, 2026
@someshkoli
Copy link
Copy Markdown
Author

Lost track of time with this one, will update the pr

Also, we've been using this in nuonco/nuon since few months now

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.

3 participants