pulumi/pkg/codegen/testing/test/testdata
Guinevere Saenger de0dcbfec6
[codegen/go] Update Go SDK function output to check for errors (#9274)
* [codegen/go] Update Go SDK function output to check for errors

Fixes https://github.com/pulumi/pulumi-aws/issues/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)
}
```

* Fix generated code panic on *nil (#9284)

* [codegen/go] Update Go SDK function output to check for errors

Fixes https://github.com/pulumi/pulumi-aws/issues/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>

* Update CHANGELOG_PENDING.md

Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
2022-03-24 20:11:53 -07:00
..
aws-eks-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
aws-fargate-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
aws-optionals-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
aws-resource-options-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
aws-s3-folder-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
aws-s3-logging-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
aws-secret-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
aws-webserver-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
azure-native-nested-types Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
azure-native-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
azure-sa-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
cyclic-types Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
dash-named-schema Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
dashed-import-schema Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
different-enum Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
different-package-name-conflict export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
external-go-import-aliases [codegen/go] Don't error for 3rd party Go SDKs - assume v1 default instead (#7208) 2022-03-02 11:57:33 -08:00
external-node-compatibility export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
external-python-same-module-name export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
external-resource-schema [codegen/go] Update Go SDK function output to check for errors (#9274) 2022-03-24 20:11:53 -07:00
functions-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
hyphen-url Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
internal-dependencies-go [codegen/go] Add support for specifying internal dependencies (#9183) 2022-03-18 17:02:33 -07:00
invalid-go-sprintf-pp Fix 8940 invalid go code generated (#8941) 2022-02-08 08:45:24 -05:00
kubernetes-operator-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
kubernetes-pod-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
kubernetes-template-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
naming-collisions Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
nested-module Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
nested-module-thirdparty Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
other-owned Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
output-funcs [codegen/go] Update Go SDK function output to check for errors (#9274) 2022-03-24 20:11:53 -07:00
output-funcs-aws-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
output-funcs-edgeorder [codegen/go] Update Go SDK function output to check for errors (#9274) 2022-03-24 20:11:53 -07:00
output-funcs-tfbridge20 [codegen/go] Update Go SDK function output to check for errors (#9274) 2022-03-24 20:11:53 -07:00
plain-and-default Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
plain-object-defaults [codegen/go] Update Go SDK function output to check for errors (#9274) 2022-03-24 20:11:53 -07:00
plain-object-disable-defaults [codegen/go] Update Go SDK function output to check for errors (#9274) 2022-03-24 20:11:53 -07:00
plain-schema-gh6957 Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
provider-config-schema Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
random-pet-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
regress-8403 Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
regress-go-8664 [codegen/go] Don't error for 3rd party Go SDKs - assume v1 default instead (#7208) 2022-03-02 11:57:33 -08:00
regress-node-8110 Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
replace-on-change Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
resource-args-python Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
resource-args-python-case-insensitive Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
resource-property-overlap Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
schema export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
simple-enum-schema Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
simple-methods-schema Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
simple-methods-schema-single-value-returns Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
simple-plain-schema Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
simple-plain-schema-with-root-package Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
simple-resource-schema [codegen/go] Update Go SDK function output to check for errors (#9274) 2022-03-24 20:11:53 -07:00
simple-resource-schema-custom-pypackage-name [codegen/go] Update Go SDK function output to check for errors (#9274) 2022-03-24 20:11:53 -07:00
simple-yaml-schema Add data attribute tag for swifttype to resource property element (#9226) 2022-03-21 10:36:04 -07:00
third-party-package-pp export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
.gitignore export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
aws-native.json export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
aws.json export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
azure-native.json export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
azure.json export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
kubernetes.json export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
other.json export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
random.json export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
types.json export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00