diff --git a/schema/functions.go b/schema/functions.go index bda1a4f7..39756b88 100644 --- a/schema/functions.go +++ b/schema/functions.go @@ -39,3 +39,14 @@ func FunctionsForVersion(v *version.Version) (map[string]schema.FuncSignature, e // TODO return funcs_v0_12.Functions(ver) instead? return nil, errors.New("no matching functions found") } + +func FunctionsForConstraint(vc version.Constraints) (map[string]schema.FuncSignature, error) { + for _, v := range terraformVersions { + if vc.Check(v) { + return FunctionsForVersion(v) + } + } + + // TODO create error struct + return nil, errors.New("no matching functions found") +}