-
Notifications
You must be signed in to change notification settings - Fork 212
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
make tree struct properties and tomlValue public #466
Comments
No good reason for those types to be private -- it was a design error years ago when I was learning Go. As future work, I'd like to break backward compatibility and create a new interface for manipulating TOML documents that does not suffer from all the shortcomings the current one has. In the meantime, I am open to making those types available if we can find a backward-compatible way to do it! |
I think as a quick fix, we can probably create new types with public props and methods to create from the existing closed types. If I'm not wrong, that should work and only add a functionality without breaking the existing impl. What do you think? |
Sounds reasonable. Looks like a method on Tree to convert wouldn't even be necessary, as you could just cast it to the public type? |
i think so, I realized as I was doing it that the even more simple type aliasing make things easy. |
I'm trying to enable toml for https://github.com/mozilla/sops with this lib, but it's quite difficult not to be able to work directly with the comment/values/tomlValue in order to parse the toml.Tree into sops.TreeBranches.
I tried to work with the map ( tree.ToMap() ) but it makes things quite complicated for no reason (on top of losing the comments and positions).
Is there any reason why these types/properties were kept private?
Any possibility of making these public? or creating a new public struct type and a new function allowing the access to these infos?
The text was updated successfully, but these errors were encountered: