pulumi/pkg/resource/stack
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 [secrets] Fix + refactor bulk decryption. (#9039) 2022-02-25 08:51:52 -08:00
checkpoint.go filestate/internal: Use stack reference, not name 2023-03-16 14:44:33 -07:00
checkpoint_test.go all: Drop ioutil 2023-01-06 16:35:14 -08:00
deployment.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
deployment_test.go This commit adds the `Created` and `Modified` timestamps to pulumi state that are optional. 2023-03-27 09:28:26 -07:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
plan.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
secrets.go Change secret.Manager State to json.RawMessage 2023-05-22 11:21:15 +01:00
secrets_test.go Change secret.Manager State to json.RawMessage 2023-05-22 11:21:15 +01:00