-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go program gen: All.Apply func rewriter #4858
Conversation
Diff for pulumi-azuread with merge commit 3da1cca |
Diff for pulumi-random with merge commit 3da1cca |
Diff for pulumi-kubernetes with merge commit 3da1cca |
Diff for pulumi-random with merge commit dd6ee52 |
Diff for pulumi-azuread with merge commit dd6ee52 |
Diff for pulumi-kubernetes with merge commit dd6ee52 |
Diff for pulumi-gcp with merge commit dd6ee52 |
Diff for pulumi-gcp with merge commit 3da1cca |
Diff for pulumi-azure with merge commit 3da1cca |
Diff for pulumi-azure with merge commit dd6ee52 |
Diff for pulumi-aws with merge commit dd6ee52 |
Diff for pulumi-aws with merge commit 3da1cca |
Diff for pulumi-random with merge commit f10a39f |
Diff for pulumi-azuread with merge commit f10a39f |
Diff for pulumi-kubernetes with merge commit f10a39f |
Diff for pulumi-gcp with merge commit f10a39f |
Diff for pulumi-azure with merge commit f10a39f |
Diff for pulumi-aws with merge commit f10a39f |
Fixes #4832
Other languages like javascript take advantage of destructuring to simplify
All.Apply
by generating something like[a1, a2, a3]
, this allows the body to be emitted in an unmodified state. Go doesn't support this syntax so we create a set of variable declarations with type assertions to prepend to the body that shadow the original variables:In this manner, we can leave the body untouched and don't have to mess around with rewriting all of the scope traversal expressions, generating type assertions inline, etc.