pulumi/pkg/codegen/go
Aaron Friel ee709d6c52 [codegen/go] Improve optional params in invoke
As described in #8821, docs generated for helper functions can be incorrect because optional arguments to parameter objects are not correctly handled.

Previously, code would be generated like so:

```go
    policyDocument, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
      Statements: []iam.GetPolicyDocumentStatement{
        iam.GetPolicyDocumentStatement{
          Sid: "1",
          //...
```

However "Sid" is of type `*string`.

This four helper conversion functions, to handle the primitive types we lower from, and modifies codegen to recursively apply these functions inside of an invoke call.

In the new code generation, the above is instead rendered as:

```go
    policyDocument, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
      Statements: []iam.GetPolicyDocumentStatement{
        iam.GetPolicyDocumentStatement{
          Sid: pulumi.StringRef("1"),
          //...
```
2022-02-01 11:44:40 -08:00
..
doc.go Fix default package name (#8187) 2021-10-11 15:28:11 -07:00
doc_test.go Validate Name, Version and Enviroment (#7896) 2021-09-17 12:12:22 -07:00
gen.go [sdk/go] Embed PluginDownloadURL during codegen (#8690) 2022-01-10 17:38:54 -08:00
gen_crd2pulumi.go [codegen/go] Call site defaults for Pulumi Object types (#8411) 2021-11-23 15:10:15 -08:00
gen_program.go Program codegen correctly handles foreign imports (#8861) 2022-01-31 21:48:32 +01:00
gen_program_expression_test.go iwahbe/7802/compile program generator test output (#8036) 2021-09-29 11:33:57 -07:00
gen_program_expressions.go [codegen/go] Improve optional params in invoke 2022-02-01 11:44:40 -08:00
gen_program_json.go Reify `Input` and `Optional` types in the schema type system. (#7059) 2021-06-24 09:17:55 -07:00
gen_program_optionals.go [codegen/go] Improve optional params in invoke 2022-02-01 11:44:40 -08:00
gen_program_read_dir.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
gen_program_splat.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
gen_program_ternaries.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
gen_program_test.go [codegen/go] Improve optional params in invoke 2022-02-01 11:44:40 -08:00
gen_program_utils.go Implemented filebase64sha256 & fileArchive support for codegen (#7997) 2022-01-21 16:03:25 +02:00
gen_spill.go Reify `Input` and `Optional` types in the schema type system. (#7059) 2021-06-24 09:17:55 -07:00
gen_test.go Fix default package name (#8187) 2021-10-11 15:28:11 -07:00
importer.go Do not generate Go inputty types for output-only schema types (#7943) 2021-12-10 15:35:24 -08:00
utilities.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
utilities_test.go [codegen/*] - Fix enum names that start with an underscore. (#5950) 2020-12-16 09:22:44 -08:00