hclutils

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DowngradeDiags

func DowngradeDiags(diags hcl.Diagnostics) hcl.Diagnostics

DowngradeDiags downgrades all errors in the supplied diags to warnings and returns it. This is a destructive operation, clone the diags before calling this function if you need the original.

func Err2Diag

func Err2Diag(err error) *hcl.Diagnostic

Err2Diag converts an error to a hcl.Diagnostic.

func HasVariable

func HasVariable(ctx *hcl.EvalContext, name string) bool

HasVariable returns true if the supplied name is defined in the current or any ancestor context.

func IsIdentifier

func IsIdentifier(s string) bool

IsIdentifier returns true if the supplied string can be interpreted as an HCL identifier.

func NormalizeTraversal

func NormalizeTraversal(t hcl.Traversal) hcl.Traversal

NormalizeTraversal normalizes an index traversal to an attribute traversal for known cases. (i.e. x["foo"] is effectively turned to x.foo).

func ToErrorDiag

func ToErrorDiag(summary string, details string, r hcl.Range) hcl.Diagnostics

ToErrorDiag create diagnostics with the supplied summary, details, and range.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL