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
Is it an option an implementing Encoder.CompactComments(bool)
method?
#540
Comments
Hi! I'm happy to merge that feature to go-toml v1. I'm not sure yet if I want to include it in go-toml v2: my current thinking has been to minimize the amount of options on encoding but instead provide the tools to write an encoder that tailor to specific needs. |
Merged! |
Thank you, I am looking forward to seeing how the v2 will look like. And the v1 looks like a charm to me! |
Hey Thomas @pelletier, sorry for disturbing you, but can you, maybe, release 1.9.2 version with this feature, please? I already use it and it would be very useful to have it stable |
Sorry, completely forgot! Let me do it now. |
Hello. I continue to playing around with the library.
I've found, that with the current code it's impossible to get the compact config output when comments are used. Each comment produces an additional line and it's difficult to overview the config. As a workaround, I use the following snippet, but it removes spaces between sections too:
So, I have now the config like
And I'd like to have it
I've found a place that should be patched, https://github.com/pelletier/go-toml/blob/c893dbf/tomltree_write.go#L417
My question is would you consider the
Encoder.CompactComments(bool)
method to trigger the compact output for comment-lines?upd: well, I already have created #541
The text was updated successfully, but these errors were encountered: