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

[Question] hclwrite - Insert / InsertNode #589

Open
aleqsss opened this issue Feb 22, 2023 · 0 comments
Open

[Question] hclwrite - Insert / InsertNode #589

aleqsss opened this issue Feb 22, 2023 · 0 comments

Comments

@aleqsss
Copy link

aleqsss commented Feb 22, 2023

I closed my other open issue #581, in favour of this more concrete one.

Looking at the hclwrite functions Insert and InsertNode, what do they expect as input for the pos *node argument?

An example would be great! I'm completely new to GO and I've been trying lots of stuff to the best of my abilities, but I struggle to being able to use the functions since I have no idea how to. However, being able to insert nodes at given positions is something that I'd really need to be able to do, so I'm really hoping for this functionality. 🙂

For the sake of it, an excerpt from the relevant part of my closed issue/question:
But what I need to do, is to insert a block at a given position inside of a body (before/after block X), so kind of a InsertBlock() function if that makes sense.
I stumbled upon the Insert and InsertNode functions, and wonder if I can make use of them in some way to achieve what I need? If so, an example would be splendid! If not, what would be a suitable solution to achieve my needs?
How could I go on using the Insert and InsertNode functions from my code, like what would be expected for the first pos *node argument? For the c nodeContent it works fine for me passing a Block() to it (I guess, since it doesn't complain), but what should I pass to the pos *node argument? An example would be awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant