cool-dress-96114
11/14/2022, 11:04 PMoutput.ApplyT
. How do you error handle with it in the Golang SDK?
I’d rather not panic if I can help it. Docs don’t say a ton https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi#OutputState.ApplyTfierce-ability-58936
11/14/2022, 11:24 PMintOutput := stringOutput.ApplyT(func(v string) int {
return len(v)
}).(pulumi.IntOutput)
or something else?cool-dress-96114
11/15/2022, 12:25 AMintOutput := stringOutput.ApplyT(func(v string) int {
i, err := foo(v)
if err != nil {
// handle this err somehow
}
return len(i)
}).(pulumi.IntOutput)
billowy-army-68599
11/15/2022, 1:16 AMintOutput := stringOutput.ApplyT(func(v string) (int, error) {
i, err := foo(v)
if err != nil {
// handle this err somehow
}
return len(i)
}).(pulumi.IntOutput)
cool-dress-96114
11/15/2022, 4:19 PM