pulumi/sdk/go
Aaron Friel 51ce3f24a7 [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 09:23:45 -08:00
..
auto Fix new lint errors (#8831) 2022-01-25 20:23:00 +01:00
common Preview of update plans (#8448) 2022-01-31 10:31:51 +00:00
pulumi [codegen/go] Improve optional params in invoke 2022-02-01 09:23:45 -08:00
pulumi-language-go Use `pulumi-plugin.json` rather than `pulumiplugin.json` (#8593) 2021-12-15 10:41:44 -08:00
Makefile Revert "Lower test parallelism on Windows (#8755)" (#8812) 2022-01-21 17:55:38 -05:00
README.md `pulumi update` => `pulumi up` (#2702) 2019-05-06 14:00:18 -07:00

README.md

Pulumi Golang SDK

This directory contains support for writing Pulumi programs in the Go language. There are two aspects to this:

  • pulumi/ contains the client language bindings Pulumi program's code directly against;
  • pulumi-language-go/ contains the language host plugin that the Pulumi engine uses to orchestrate updates.

To author a Pulumi program in Go, simply say so in your Pulumi.yaml

name: <my-project>
runtime: go

and ensure you have pulumi-language-go on your path (it is distributed in the Pulumi download automatically).

By default, the language plugin will use your project's name, <my-project>, as the executable that it loads. This too must be on your path for the language provider to load it when you run pulumi preview or pulumi up.