Skip to content
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

Merged
merged 3 commits into from
Jun 23, 2020

Conversation

EvanBoyle
Copy link
Contributor

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:

a1 := _args[0].(string) 
a2 := _args[1].(aws.Foo)
...
// temps
// rest of body

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.

@github-actions
Copy link

Diff for pulumi-azuread with merge commit 3da1cca

@github-actions
Copy link

Diff for pulumi-random with merge commit 3da1cca

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit 3da1cca

@github-actions
Copy link

Diff for pulumi-random with merge commit dd6ee52

@github-actions
Copy link

Diff for pulumi-azuread with merge commit dd6ee52

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit dd6ee52

@github-actions
Copy link

Diff for pulumi-gcp with merge commit dd6ee52

@github-actions
Copy link

Diff for pulumi-gcp with merge commit 3da1cca

@github-actions
Copy link

Diff for pulumi-azure with merge commit 3da1cca

@github-actions
Copy link

Diff for pulumi-azure with merge commit dd6ee52

@github-actions
Copy link

Diff for pulumi-aws with merge commit dd6ee52

@github-actions
Copy link

Diff for pulumi-aws with merge commit 3da1cca

@EvanBoyle EvanBoyle merged commit 4ea1f01 into master Jun 23, 2020
@pulumi-bot pulumi-bot deleted the evan/goProgramAllApplyRewrite branch June 23, 2020 18:00
@github-actions
Copy link

Diff for pulumi-random with merge commit f10a39f

@github-actions
Copy link

Diff for pulumi-azuread with merge commit f10a39f

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit f10a39f

@github-actions
Copy link

Diff for pulumi-gcp with merge commit f10a39f

@github-actions
Copy link

Diff for pulumi-azure with merge commit f10a39f

@github-actions
Copy link

Diff for pulumi-aws with merge commit f10a39f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Go Program Gen] Fix body scope traversals for pulumi.All(..).Apply()
2 participants