hcl-lang
hcl-lang copied to clipboard
`SetSchema` and `LoadFile` do not exist
Both of these functions are mentioned in the README.md but running a full text search in the project does not turn up any meaningful results in code. Am I misunderstanding something?
d, err := NewDecoder()
if err != nil {
// ...
}
d.SetSchema(schema)
// for each (known) file (e.g. any *.tf file in Terraform)
f, pDiags := hclsyntax.ParseConfig(configBytes, "example.tf", hcl.InitialPos)
if len(pDiags) > 0 {
// ...
}
err = d.LoadFile("example.tf", f)
if err != nil {
// ...
}