Allow As*Map*
and As*Array*
functions to perform inner conversions
#11348
Labels
area/sdks
Pulumi language SDKs
kind/enhancement
Improvements or new features
language/go
resolution/fixed
This issue was fixed
Milestone
Hello!
Issue details
Calling any of our
As*Map*
orAs*Array*
methods performs a direct cast on the awaited value, with no attempt to ensure the conversion is valid. This is particularly painful in go, since it is not valid to case a valuex
from[]interface{}
to[]string
, even if every value inx
is itself a string. We should modify this behavior to be more tolerant, allowing casts where each inner type is a valid cast.This change can be most easily expressed by showing the new code:
old code:
new code:
Inspired by #11347.
Affected area/feature
The text was updated successfully, but these errors were encountered: