pulumi/sdk/go/internal
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
..
gen-pux-applyn sdk/go: Add pulumix subpackage 2023-07-25 12:15:24 -07:00
resource.go sdk/go: Move Output implementation to internal 2023-07-25 11:22:30 -07:00
rpc.go sdk/go: Move Output implementation to internal 2023-07-25 11:22:30 -07:00
rpc_test.go sdk/go: Move Output implementation to internal 2023-07-25 11:22:30 -07:00
state.go sdk/go: Add pulumix subpackage 2023-07-25 12:15:24 -07:00
state_test.go sdk/go: Move Output implementation to internal 2023-07-25 11:22:30 -07:00
types.go sdk/go: Add pulumix subpackage 2023-07-25 12:15:24 -07:00
types_test.go sdk/go: Move Output implementation to internal 2023-07-25 11:22:30 -07:00
workgroup.go sdk/go: Move Output implementation to internal 2023-07-25 11:22:30 -07:00
workgroup_test.go sdk/go: Move Output implementation to internal 2023-07-25 11:22:30 -07:00