pulumi/pkg/operations
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
..
testdata Don't include pending-delete resources in tree representation (#902) 2018-02-12 08:47:09 -08:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
operations.go Collect logs from Google Cloud Functions 2019-04-08 09:44:05 -07:00
operations_aws.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
operations_aws_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
operations_cloud_aws.go ci: gofmt 1.18+ clean 2022-09-21 09:48:39 -07:00
operations_cloud_aws_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
operations_gcp.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
resources.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
resources_test.go Merge #11817 2023-01-12 18:08:03 +00:00