mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
Update go-cty to pull in more stdlib funcs.
I needed "split" specifically so I can do something like: ```hcl variable PLATFORMS { default = "linux/amd64" } target foo { platforms = split(",", "${PLATFORMS}") # other stuff } ``` Where the existing "csvdecode" does not work for this because it parses the string into a list of objects instead of a list of strings. I went ahead and just added all the available new functions. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
9
vendor/github.com/zclconf/go-cty/cty/convert/conversion.go
generated
vendored
9
vendor/github.com/zclconf/go-cty/cty/convert/conversion.go
generated
vendored
@ -138,6 +138,15 @@ func getConversionKnown(in cty.Type, out cty.Type, unsafe bool) conversion {
|
||||
outEty := out.ElementType()
|
||||
return conversionObjectToMap(in, outEty, unsafe)
|
||||
|
||||
case out.IsObjectType() && in.IsMapType():
|
||||
if !unsafe {
|
||||
// Converting a map to an object is an "unsafe" conversion,
|
||||
// because we don't know if all the map keys will correspond to
|
||||
// object attributes.
|
||||
return nil
|
||||
}
|
||||
return conversionMapToObject(in, out, unsafe)
|
||||
|
||||
case in.IsCapsuleType() || out.IsCapsuleType():
|
||||
if !unsafe {
|
||||
// Capsule types can only participate in "unsafe" conversions,
|
||||
|
Reference in New Issue
Block a user