Skip to content

Commit adb8823

Browse files
go.mod: Use cty v1.13.0, with support for refined unknown values
This new concept allows constraining the range of an unknown value beyond what can be captured in a type constraint. We'll make more use of this in subsequent commits.
1 parent e54a196 commit adb8823

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7
1515
github.com/sergi/go-diff v1.0.0
1616
github.com/spf13/pflag v1.0.2
17-
github.com/zclconf/go-cty v1.12.1
17+
github.com/zclconf/go-cty v1.13.0
1818
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b
1919
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167
2020
)
@@ -23,7 +23,7 @@ require (
2323
github.com/kr/text v0.1.0 // indirect
2424
github.com/pmezard/go-difflib v1.0.0 // indirect
2525
github.com/stretchr/testify v1.2.2 // indirect
26-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
26+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
2727
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
28-
golang.org/x/text v0.3.7 // indirect
28+
golang.org/x/text v0.3.8 // indirect
2929
)

go.sum

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,21 @@ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1
3131
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
3232
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
3333
github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
34-
github.com/zclconf/go-cty v1.12.0 h1:F5E/vbilcrCtat9sYcEjlwwg1mDqbRTjyXR57nnx5sc=
35-
github.com/zclconf/go-cty v1.12.0/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA=
36-
github.com/zclconf/go-cty v1.12.1 h1:PcupnljUm9EIvbgSHQnHhUr3fO6oFmkOrvs2BAFNXXY=
37-
github.com/zclconf/go-cty v1.12.1/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA=
34+
github.com/zclconf/go-cty v1.13.0 h1:It5dfKTTZHe9aeppbNOda3mN7Ag7sg6QkBNm6TkyFa0=
35+
github.com/zclconf/go-cty v1.13.0/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0=
3836
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI=
3937
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8=
4038
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCojM4mN6UemYv8K+dCnmHmu0=
4139
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
4240
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
4341
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
4442
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
45-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
46-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
43+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
44+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
4745
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
4846
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
4947
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
50-
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
51-
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
48+
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
49+
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
5250
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
5351
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

hclsyntax/expression_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestExpressionParseAndValue(t *testing.T) {
6060
"unk": cty.UnknownVal(cty.Number),
6161
},
6262
},
63-
cty.UnknownVal(cty.Number),
63+
cty.UnknownVal(cty.Number).RefineNotNull(),
6464
0,
6565
},
6666
{
@@ -70,7 +70,7 @@ func TestExpressionParseAndValue(t *testing.T) {
7070
"unk": cty.DynamicVal,
7171
},
7272
},
73-
cty.UnknownVal(cty.Number),
73+
cty.UnknownVal(cty.Number).RefineNotNull(),
7474
0,
7575
},
7676
{
@@ -80,7 +80,7 @@ func TestExpressionParseAndValue(t *testing.T) {
8080
"unk": cty.DynamicVal,
8181
},
8282
},
83-
cty.UnknownVal(cty.Number),
83+
cty.UnknownVal(cty.Number).RefineNotNull(),
8484
0,
8585
},
8686
{
@@ -2098,7 +2098,7 @@ func TestFunctionCallExprValue(t *testing.T) {
20982098
&hcl.EvalContext{
20992099
Functions: funcs,
21002100
},
2101-
cty.UnknownVal(cty.Number),
2101+
cty.UnknownVal(cty.Number).Refine().NotNull().NumberRangeLowerBound(cty.NumberIntVal(0), true).NewValue(),
21022102
0,
21032103
},
21042104
"valid call with unknown arg needing conversion": {
@@ -2113,7 +2113,7 @@ func TestFunctionCallExprValue(t *testing.T) {
21132113
&hcl.EvalContext{
21142114
Functions: funcs,
21152115
},
2116-
cty.UnknownVal(cty.Number),
2116+
cty.UnknownVal(cty.Number).Refine().NotNull().NumberRangeLowerBound(cty.NumberIntVal(0), true).NewValue(),
21172117
0,
21182118
},
21192119
"valid call with dynamic arg": {
@@ -2128,7 +2128,7 @@ func TestFunctionCallExprValue(t *testing.T) {
21282128
&hcl.EvalContext{
21292129
Functions: funcs,
21302130
},
2131-
cty.UnknownVal(cty.Number),
2131+
cty.UnknownVal(cty.Number).Refine().NotNull().NumberRangeLowerBound(cty.NumberIntVal(0), true).NewValue(),
21322132
0,
21332133
},
21342134
"invalid arg type": {

0 commit comments

Comments
 (0)