package tryfunc
import "github.com/hashicorp/hcl/v2/ext/tryfunc"
Package tryfunc contains some optional functions that can be exposed in HCL-based languages to allow authors to test whether a particular expression can succeed and take dynamic action based on that result.
These functions are implemented in terms of the customdecode extension from the sibling directory "customdecode", and so they are only useful when used within an HCL EvalContext. Other systems using cty functions are unlikely to support the HCL-specific "customdecode" extension.
Index ¶
Variables ¶
CanFunc tries to evaluate the expression given in its first argument.
TryFunc is a variadic function that tries to evaluate all of is arguments in sequence until one succeeds, in which case it returns that result, or returns an error if none of them succeed.
Source Files ¶
- Version
- v2.20.0
- Published
- Feb 29, 2024
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 10 hours ago –
Tools for package owners.