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
[codegen/go] Update Go SDK function output to check for errors #9274
Conversation
Diff for pulumi-random with merge commit 78f5af7 |
Diff for pulumi-azuread with merge commit 78f5af7 |
Diff for pulumi-kubernetes with merge commit 78f5af7 |
Diff for pulumi-gcp with merge commit 78f5af7 |
Diff for pulumi-azure with merge commit 78f5af7 |
Diff for pulumi-aws with merge commit 78f5af7 |
Minor corrections here: #9284 |
Fixes pulumi/pulumi-aws#1872. This should result in the following sample output in the Go SDK: ``` func GetPolicyDocumentOutput(ctx *pulumi.Context, args GetPolicyDocumentOutputArgs, opts ...pulumi.InvokeOption) GetPolicyDocumentResultOutput { return pulumi.ToOutputWithContext(context.Background(), args). ApplyT(func(v interface{}) (GetPolicyDocumentResult, error) { args := v.(GetPolicyDocumentArgs) r, err := GetPolicyDocument(ctx, &args, opts...) if err != nil { return nil, err } if r == nil { return nil, fmt.Errorf("expected either result or error to be nil, not both") } return *r, err }).(GetPolicyDocumentResultOutput) } ```
30e6949
to
b55c8c1
Compare
Diff for pulumi-azuread with merge commit 72e5489 |
Diff for pulumi-random with merge commit 72e5489 |
Diff for pulumi-kubernetes with merge commit 72e5489 |
Diff for pulumi-gcp with merge commit 72e5489 |
Diff for pulumi-azure with merge commit 72e5489 |
Diff for pulumi-aws with merge commit 72e5489 |
* [codegen/go] Update Go SDK function output to check for errors Fixes pulumi/pulumi-aws#1872. This should result in the following sample output in the Go SDK: ``` func GetPolicyDocumentOutput(ctx *pulumi.Context, args GetPolicyDocumentOutputArgs, opts ...pulumi.InvokeOption) GetPolicyDocumentResultOutput { return pulumi.ToOutputWithContext(context.Background(), args). ApplyT(func(v interface{}) (GetPolicyDocumentResult, error) { args := v.(GetPolicyDocumentArgs) r, err := GetPolicyDocument(ctx, &args, opts...) if r != nil { s = *r } return s, err }).(GetPolicyDocumentResultOutput) } ``` * Alternate fix to safeguard dereferencing nil * Accept codegen changes in the test suite Co-authored-by: Guinevere Saenger <guinevere@pulumi.com>
Diff for pulumi-azuread with merge commit 499e3d7 |
Diff for pulumi-random with merge commit 499e3d7 |
Diff for pulumi-kubernetes with merge commit 499e3d7 |
Diff for pulumi-gcp with merge commit 499e3d7 |
Diff for pulumi-azure with merge commit 499e3d7 |
Diff for pulumi-aws with merge commit 499e3d7 |
Diff for pulumi-azure-native with merge commit 499e3d7 |
I'm running pulumi cli 3.37.2, and it appears this is still an issue. Do you know what's going on? |
Fixes pulumi/pulumi-aws#1872.
This should result in the following sample output in the Go SDK:
Description
Fixes # (issue)
Checklist