6c4344623b
The main HCL package is more visible this way, and so it's easier than having to pick it out from dozens of other package directories.
17 lines
274 B
Go
17 lines
274 B
Go
package fuzztemplate
|
|
|
|
import (
|
|
"github.com/hashicorp/hcl/v2"
|
|
"github.com/hashicorp/hcl/v2/hclsyntax"
|
|
)
|
|
|
|
func Fuzz(data []byte) int {
|
|
_, diags := hclsyntax.ParseTemplate(data, "<fuzz-tmpl>", hcl.Pos{Line: 1, Column: 1})
|
|
|
|
if diags.HasErrors() {
|
|
return 0
|
|
}
|
|
|
|
return 1
|
|
}
|