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:
20
vendor/github.com/zclconf/go-cty/cty/path.go
generated
vendored
20
vendor/github.com/zclconf/go-cty/cty/path.go
generated
vendored
@ -51,11 +51,31 @@ func (p Path) Index(v Value) Path {
|
||||
return ret
|
||||
}
|
||||
|
||||
// IndexInt is a typed convenience method for Index.
|
||||
func (p Path) IndexInt(v int) Path {
|
||||
return p.Index(NumberIntVal(int64(v)))
|
||||
}
|
||||
|
||||
// IndexString is a typed convenience method for Index.
|
||||
func (p Path) IndexString(v string) Path {
|
||||
return p.Index(StringVal(v))
|
||||
}
|
||||
|
||||
// IndexPath is a convenience method to start a new Path with an IndexStep.
|
||||
func IndexPath(v Value) Path {
|
||||
return Path{}.Index(v)
|
||||
}
|
||||
|
||||
// IndexIntPath is a typed convenience method for IndexPath.
|
||||
func IndexIntPath(v int) Path {
|
||||
return IndexPath(NumberIntVal(int64(v)))
|
||||
}
|
||||
|
||||
// IndexStringPath is a typed convenience method for IndexPath.
|
||||
func IndexStringPath(v string) Path {
|
||||
return IndexPath(StringVal(v))
|
||||
}
|
||||
|
||||
// GetAttr returns a new Path that is the reciever with a GetAttrStep appended
|
||||
// to the end.
|
||||
//
|
||||
|
Reference in New Issue
Block a user