vendor: update cty to v0.0.0-20180831220647-752f6a689f5e

This includes a fix to UnknownAsNull to make it not crash when given a
value that is _already_ null.
This commit is contained in:
Martin Atkins 2018-08-31 17:13:25 -07:00
parent 9c9a918790
commit 0341c78320
4 changed files with 8 additions and 6 deletions

2
go.mod
View File

@ -130,7 +130,7 @@ require (
github.com/xanzy/ssh-agent v0.1.0
github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 // indirect
github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557
github.com/zclconf/go-cty v0.0.0-20180829180805-c2393a5d54f2
github.com/zclconf/go-cty v0.0.0-20180831220647-752f6a689f5e
golang.org/x/crypto v0.0.0-20180816225734-aabede6cba87
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d
golang.org/x/oauth2 v0.0.0-20170928010508-bb50c06baba3

2
go.sum
View File

@ -278,6 +278,8 @@ github.com/zclconf/go-cty v0.0.0-20180827182259-5a135111c744 h1:JNsGrc8/oqtTgRC2
github.com/zclconf/go-cty v0.0.0-20180827182259-5a135111c744/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty v0.0.0-20180829180805-c2393a5d54f2 h1:6kLV7zzkF4LbOhuztGPIJjd/u7csij6t3GXRz/1hu2Y=
github.com/zclconf/go-cty v0.0.0-20180829180805-c2393a5d54f2/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty v0.0.0-20180831220647-752f6a689f5e h1:6R+foJ4aZJ3r0v9GajwCV7WuYCJ4J0H2ySXGUs093qc=
github.com/zclconf/go-cty v0.0.0-20180831220647-752f6a689f5e/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
golang.org/x/crypto v0.0.0-20180816225734-aabede6cba87 h1:gCHhzI+1R9peHIMyiWVxoVaWlk1cYK7VThX5ptLtbXY=
golang.org/x/crypto v0.0.0-20180816225734-aabede6cba87/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/net v0.0.0-20180811021610-c39426892332 h1:efGso+ep0DjyCBJPjvoz0HI6UldX4Md2F1rZFe1ir0E=

View File

@ -8,12 +8,12 @@ package cty
// represent unknowns, such as JSON, as long as the caller does not need to
// retain the unknown value information.
func UnknownAsNull(val Value) Value {
if !val.IsKnown() {
return NullVal(val.Type())
}
ty := val.Type()
switch {
case val.IsNull():
return val
case !val.IsKnown():
return NullVal(ty)
case ty.IsListType() || ty.IsTupleType() || ty.IsSetType():
length := val.LengthInt()
if length == 0 {

2
vendor/modules.txt vendored
View File

@ -447,7 +447,7 @@ github.com/vmihailenco/msgpack/codes
github.com/xanzy/ssh-agent
# github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557
github.com/xlab/treeprint
# github.com/zclconf/go-cty v0.0.0-20180829180805-c2393a5d54f2
# github.com/zclconf/go-cty v0.0.0-20180831220647-752f6a689f5e
github.com/zclconf/go-cty/cty
github.com/zclconf/go-cty/cty/gocty
github.com/zclconf/go-cty/cty/convert