mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
buildflags: make work on go 1.22 by reverting rangefunc usage
Reverts the usage of rangefunc and attempts to keep the foundation of it in for when we move to go 1.23. We have downstream dependencies that aren't ready to move to go 1.23. We can likely move after go 1.24 is released. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
@ -22,16 +22,19 @@ func (e *Attests) FromCtyValue(in cty.Value, p cty.Path) error {
|
||||
return p.NewErrorf("%s", convert.MismatchMessage(got, want))
|
||||
}
|
||||
|
||||
func (e *Attests) fromCtyValue(in cty.Value, p cty.Path) error {
|
||||
func (e *Attests) fromCtyValue(in cty.Value, p cty.Path) (retErr error) {
|
||||
*e = make([]*Attest, 0, in.LengthInt())
|
||||
for value := range eachElement(in) {
|
||||
|
||||
yield := func(value cty.Value) bool {
|
||||
entry := &Attest{}
|
||||
if err := entry.FromCtyValue(value, p); err != nil {
|
||||
return err
|
||||
if retErr = entry.FromCtyValue(value, p); retErr != nil {
|
||||
return false
|
||||
}
|
||||
*e = append(*e, entry)
|
||||
return true
|
||||
}
|
||||
return nil
|
||||
eachElement(in)(yield)
|
||||
return retErr
|
||||
}
|
||||
|
||||
func (e Attests) ToCtyValue() cty.Value {
|
||||
|
Reference in New Issue
Block a user