hcl-lang icon indicating copy to clipboard operation
hcl-lang copied to clipboard

`SetSchema` and `LoadFile` do not exist

Open rcjsuen opened this issue 1 year ago • 1 comments

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 {
	// ...
}

rcjsuen avatar Oct 08 '24 12:10 rcjsuen