Hi, is there a way to check if a pulumi StringOupu...
# general
l
Hi, is there a way to check if a pulumi StringOuput is empty or not (using Golang)?
e
Copy code
str.ApplyT(func(v string) (bool, error) {
		if v == "" {
			return false, nil
		}
		return true, nil
	}).(pulumi.BoolOutput)
You'll get a BoolOutput rather than a bool, but that's unavoidable.
l
Good find. Thanks!
I worked around it by not using an output. I could use a
pulumi.stringarray
which can be checked with
len()