pulumi/sdk/go
Mathias Lafeldt bbf5b0d421
Fix slice bounds out of range panic in fixupPath (#16575)
I noticed that sst currently panics if an environment variable's name is
shorter than 5 characters. This fixes the root cause.

```
V=1 sst deploy --stage=dev 
SST ❍ ion 0.0.416  ready!

➜  App:        myapp
   Stage:      dev

~  Deploying

panic: runtime error: slice bounds out of range [:5] with length 3

goroutine 1 [running]:
github.com/pulumi/pulumi/sdk/v3/go/auto.fixupPath({0x140018ec408, 0xb1, 0x1400013dfc0?}, {0x1400013dfc0, 0x32})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/cmd.go:324 +0x270
github.com/pulumi/pulumi/sdk/v3/go/auto.pulumiCommand.Run({{0x3, 0x73, 0x2, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}}, {0x1400013dfc0, ...}}, ...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/cmd.go:273 +0x394
github.com/pulumi/pulumi/sdk/v3/go/auto.(*LocalWorkspace).runPulumiInputCmdSync(0x14001494000, {0x106fb2b28, 0x1400061c0f0}, {0x0, 0x0}, {0x14000aeba00, 0x4, 0x4})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/local_workspace.go:776 +0x1f4
github.com/pulumi/pulumi/sdk/v3/go/auto.(*LocalWorkspace).runPulumiCmdSync(...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/local_workspace.go:790
github.com/pulumi/pulumi/sdk/v3/go/auto.(*LocalWorkspace).SelectStack(0x14001494000, {0x106fb2b28, 0x1400061c0f0}, {0x16b392623, 0x3})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/local_workspace.go:568 +0x160
github.com/pulumi/pulumi/sdk/v3/go/auto.SelectStack({0x106fb2b28?, 0x1400061c0f0?}, {0x16b392623, 0x3}, {0x106fcd6e0, 0x14001494000})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/stack.go:179 +0x5c
github.com/pulumi/pulumi/sdk/v3/go/auto.UpsertStack({0x106fb2b28, 0x1400061c0f0}, {0x16b392623, 0x3}, {0x106fcd6e0, 0x14001494000})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.115.2/go/auto/stack.go:191 +0x34
github.com/sst/ion/pkg/project.(*stack).Run(0x14000a42058, {0x106fb2b28, 0x1400061c0f0}, 0x140000bbcc0)
        /home/runner/work/ion/ion/pkg/project/stack.go:283 +0x1cf4
main.init.func3(0x14000064550)
        /home/runner/work/ion/ion/cmd/sst/main.go:458 +0x2c8
main.run()
        /home/runner/work/ion/ion/cmd/sst/main.go:160 +0x6cc
main.main()
        /home/runner/work/ion/ion/cmd/sst/main.go:52 +0x12c
```
2024-07-08 09:10:58 +00:00
..
auto Fix slice bounds out of range panic in fixupPath (#16575) 2024-07-08 09:10:58 +00:00
common New deployment settings wizards and environment variables management comands (#16564) 2024-07-03 20:24:26 +00:00
internal turn on the golangci-lint exhaustive linter (#15028) 2024-01-17 16:50:41 +00:00
property Property map keys are just strings (#15767) 2024-03-25 17:26:41 +00:00
pulumi Keep package refs separate from providers (#16458) 2024-06-24 14:59:18 +00:00
pulumi-language-go Changelog and go.mod updates for v3.122.0 (#16551) 2024-07-02 07:54:27 +00:00
pulumix Use EqualError/ErrorContains instead of Error (#14737) 2023-12-08 06:40:14 +00:00
Makefile make(sdk/go): Use -C instead of cd for 'go' commands (#13853) 2023-08-31 21:12:03 +00: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.