https://pulumi.com logo
#general
Title
# general
a

adventurous-planet-77099

11/21/2023, 11:16 PM
How do i pass []internal.Output to pulumi.All() in go
cannot use nodesOutput (variable of type []"<http://github.com/pulumi/pulumi/sdk/v3/go/internal|github.com/pulumi/pulumi/sdk/v3/go/internal>".Output) as []interface{} value in argument to pulumi.AllcompilerIncompatibleAssign
var nodesOutput []internal.Output
when doing this
pulumi.All(nodesOutput...).ApplyT(func(args []interface{}) error {
for _, a := range args {
fmt.Println(a.(NodeInfo))
}
return nil
})
It works when im passing manually pulumi.All(nodesOutput[0],nodesOutput[1])
l

little-cartoon-10569

11/22/2023, 12:19 AM
Is there an equivalent to the Typescript
...
operator? A spread operator?
Looks like you have to turn the array into slices (whatever they are) then use the
...
operator: https://stackoverflow.com/a/17556146/3195526
Also fyi, you might get more expert advice at #golang