pulumi/sdk/go
Abhinav Gupta 7ff4b2c8be
sdk/go: Add pulumix subpackage
Adds the pulumix subpackage implementing strongly-typed
inputs, outputs, and combinators.

internal/cmd/gen-pux-applyn generates all four variants of `Apply` for
up to 8 parameters.

**Note**:
Input[T] is not a constraint for most combinators.
Making Input[T] a constraint for the provided combinators
results in annoying, unreadable type signatures.
Users will not find these enjoyable to use.

```go
func Apply8[
	I1 Input[A1], I2 Input[A2], I3 Input[A3], I4 Input[A4], I5 Input[A5], I6 Input[A6], I7 Input[A7], I8 Input[A8],
	A1, A2, A3, A4, A5, A6, A7, A8, B any,
](
	i1 I1, i2 I2, i3 I3, i4 I4, i5 I5, i6 I6, i7 I7, i8 I8,
	fn func(A1, A2, A3, A4, A5, A6, A7, A8) B,
) Output[B]
```

Versus:

```go
func Apply8[A1, A2, A3, A4, A5, A6, A7, A8, B any](
	i1 Input[A1], i2 Input[A2], i3 Input[A3], i4 Input[A4], i5 Input[A5], i6 Input[A6], i7 Input[A7], i8 Input[A8],
	fn func(A1, A2, A3, A4, A5, A6, A7, A8) B,
) Output[B]
```

Users of Go 1.21 or higher will not need to provide any type parameters
for these functions with the new, improved type inference in Go 1.21.
Users of prior versions will have to provide `A*` type parameters.
We consider this an acceptable tradeoff for the usabililty and
readability win of these APIs.
2023-07-25 12:15:24 -07:00
..
auto deps(go): Upgrade to grpc 1.56.1 2023-07-06 09:04:16 -07:00
common Extend unknown providers test to cover Construct 2023-07-25 17:13:28 +01:00
internal sdk/go: Add pulumix subpackage 2023-07-25 12:15:24 -07:00
pulumi sdk/go: Add pulumix subpackage 2023-07-25 12:15:24 -07:00
pulumi-language-go chore: post-release go.mod updates 2023-07-20 22:54:09 +00:00
pulumix sdk/go: Add pulumix subpackage 2023-07-25 12:15:24 -07:00
Makefile [sdk/go] Fix the `dist` make target 2023-06-30 16:09:03 -07: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.