I'm writing a compiler using HCL (HashiCorp Configuration Language) and I'm trying to manipulate the AST so that I can add my custom logic.
hclParseTree, err := hcl.Parse(input)
check(err)
spew.Dump(hclParseTree)
I've only managed to print all the tree elements by using go-spew.
Documentation is relatively vague and there are few supporting articles on the web. I tried to follow this one, but the syntax is deprecated (written in 2015).
How could I achieve something like this?
item := hclParseTree.Get("item")