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

Easier tools for reading/setting/getting keys #140

Open
kevinburke opened this issue Jul 26, 2016 · 0 comments
Open

Easier tools for reading/setting/getting keys #140

kevinburke opened this issue Jul 26, 2016 · 0 comments
Labels
v1 Relates to the v1 line of releases

Comments

@kevinburke
Copy link

Hi,
I'm interested in writing a program to update a config file, while preserving the comments in that file. This requires calling ParseBytes() or equivalent and then manipulating the resulting *ast.File. This is a little cumbersome. I added some helpers for getting/setting keys, in this gist:

https://gist.github.com/kevinburke/477ca3a49d67f886cd2ade96a2abaf2a

They assume the data has a little more structure than HCL provides - no listing two keys for a given ObjectList for example. But they significantly simplify the task of manipulating the AST, which is why I thought you might be interested in adding something like this to the project.

@apparentlymart apparentlymart added the v1 Relates to the v1 line of releases label Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1 Relates to the v1 line of releases
Projects
None yet
Development

No branches or pull requests

2 participants