packer/hcl2template/function/refinements.go
Wilken Rivera 263821ac25 hcl2template/functions: Add Non-null refinements for various functions
cty's new "refinements" concept allows us to reduce the range of unknown
values from our functions. This initial changeset focuses only on
declaring which functions are guaranteed to return a non-null result,
which is a helpful baseline refinement because it allows "== null" and
"!= null" tests to produce known results even when the given value is
otherwise unknown.

This commit also includes some updates to test results that are now
refined based on cty's own built-in refinement behaviors, just as a
result of us having updated cty in the previous commit.
2023-11-29 12:28:16 -05:00

9 lines
155 B
Go

package function
import (
"github.com/zclconf/go-cty/cty"
)
func refineNotNull(b *cty.RefinementBuilder) *cty.RefinementBuilder {
return b.NotNull()
}