pulumi/sdk/go/common/workspace
Fraser Waters 571fadae3f Use slice.Prealloc instead of make([]T, 0, ...)
Fixes https://github.com/pulumi/pulumi/issues/12738

https://github.com/pulumi/pulumi/pull/11834 turned on the prealloc
linter and changed a load of slice uses from just `var x T[]` to `x :=
make([]T, 0, preallocSize)`. This was good for performance but it turns
out there are a number of places in the codebase that treat a `nil`
slice as semnatically different to an empty slice.

Trying to test that, or even reason that through for every callsite is
untractable, so this PR replaces all expressions of the form `make([]T,
0, size)` with a call to `slice.Prealloc[T](size)`. When size is 0 that
returns a nil array, rather than an empty array.
2023-06-29 11:27:50 +01:00
..
config.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
creds.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
creds_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
loaders.go Remove the global caches for project files 2023-03-07 12:44:24 +00:00
paths.go Translate permission errors into ProjectNotFound when searching 2023-06-20 15:15:40 +01:00
paths_test.go Translate permission errors into ProjectNotFound when searching 2023-06-20 15:15:40 +01:00
plugins.go Handle installing plugins without versions in the defaultHost 2023-06-12 12:22:08 +01:00
plugins_install_nodejs_test.go ci: Use reduced smoke testing on Windows & macOS targets 2022-09-21 09:55:06 -07:00
plugins_install_python_test.go ci: Use reduced smoke testing on Windows & macOS targets 2022-09-21 09:55:06 -07:00
plugins_install_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
plugins_test.go add rate limited url to http requests 2023-04-24 16:16:35 +01:00
project.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
project.json fix #11864: pulumi panics when Pulumi.yaml has a provider with an empty/unspecified `path` key 2023-01-18 10:33:39 -08:00
project_test.go Test project roundtrips 2023-03-07 09:42:56 +00:00
settings.go move pkg/workspace -> sdk/go/common/workspace 2020-03-18 14:35:53 -07:00
templates.go `pulumi new` now supports numeric stack names. 2023-06-20 12:55:21 -07:00
templates_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
workspace.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00