You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The input with atlas {} is parse correctly without issue, then I append new child block, it cause the issue when I parse its ouput again. Even formatted with hclwrite.Format,
funcExample_Ident() {
// This input is fine, and valid.f, diags:=hclwrite.ParseConfig([]byte("atlas {}"), "atlas.hcl", hcl.InitialPos)
ifdiags.HasErrors() {
panic("failed to parse config")
}
// Append the cloud blockf.Body().FirstMatchingBlock("atlas", nil).
Body().AppendNewBlock("cloud", nil)
// Format the output.out:=hclwrite.Format(f.Bytes())
// Parse the output to check if it's valid._, diags=hclwrite.ParseConfig(out, "atlas.hcl", hcl.InitialPos)
fmt.Println(string(out))
fmt.Println(diags)
// Output:// atlas { cloud {// }// }// atlas.hcl:1,9-16: Argument definition required; A single-line block definition can contain only a single argument. If you meant to define argument "cloud", use an equals sign to assign it a value. To define a nested block, place it on a line of its own within its parent block.
}
The text was updated successfully, but these errors were encountered:
The input with
atlas {}
is parse correctly without issue, then I append new child block, it cause the issue when I parse its ouput again. Even formatted withhclwrite.Format
,The text was updated successfully, but these errors were encountered: