is there a standard practice for validating inputs...
# general
d
is there a standard practice for validating inputs into a component that are passed in as
pulumi.StringInput
types in go? I know I could just make them a
string
and validate them but there may be cases where they could be supplied by the end user or as an output from like a data source. So I wasn't sure how to validate them when they are
pulumi.StringInput
values... do I need to do a
.ToStringOutput().ApplyT()
and validate within the applier?
b
yes, that's the way you'd have to do it - inside the
ApplyT
sorry just saw the reply to your other thread, apologies for the delay!
d
no worries, bud... thanks 😉
if there's an error, how do I actually return it? I only see a
pulumi.Output
as a return value
i thought somewhere i saw a func returning an error as well
or do i just
throw
and error and catch it outside then
NVM think i figured it out... code complete wasn't showing the alternate FN signature