is there a way to type/cast a `stack output` objec...
# golang
m
is there a way to type/cast a
stack output
object? In one stack I export a
pulumi.StringArray{}
, when I reference this in another stack it returns type
pulumi.AnyOutput
. I want to iterate over this like an array, but currently the only way I've got round to do this is via reflection, ie:
Copy code
output1 := stackReference.GetOutput(pulumi.String("Infra"))
		
		_ = output1.ApplyT(func(list interface{}) string {

			switch reflect.TypeOf(list).Kind() {

			case reflect.Slice:
				s := reflect.ValueOf(list)

				for i := 0; i < s.Len(); i++ {
b
unfortunately no, this is the best way at the moment 😞. generics will help us here
m
Thanks for confirming @billowy-army-68599 🙂