Commit graph

11 commits

Author SHA1 Message Date
Radek Simko
0fe906fa8c make copyrightfix 2026-02-17 13:56:34 +00:00
Samsondeen
71dbc7d726
migrate command for terraform stacks (#36482) 2025-03-19 10:39:50 +01:00
James Bardin
384f2d4fab update collections to use for-range method 2024-10-04 11:22:44 -04:00
Liam Cervante
587a7e88ff
stacks: include move, forget, import counts in apply summaries (#35391) 2024-07-01 14:23:17 +02:00
Martin Atkins
2ac2f4096f collections: NewSetCmp takes optional initial elements
We previously updated the other two constructors to work this way, but
missed this one. NewSetCmp is now consistent with NewSet and NewSetFunc.
2024-04-29 09:20:53 -07:00
Martin Atkins
ef185ee6a0 collections: Don't panic when Has called on uninitialized Set
The convention for Go maps is that read operations treat an uninitialized
map as if empty, and collections.Set is intended to behave in a map-like
way, so Set.Has should return false when called on a totally-uninitialized
set.

Previously this would panic because an uninitialized set has a nil key
function.
2024-04-24 07:14:38 -07:00
Liam Cervante
64b311d53a
stacks: apply sensitive marks to outputs from components (#34684)
* stacks: apply sensitive marks to outputs from components

* gen headers

* ensure consistent test ordering
2024-02-16 10:46:50 +01:00
Martin Atkins
8cb51f415b collections: go-cmp helpers for the collection types
A downside of using custom collection types is that go-cmp doesn't support
them automatically, and so we need to help it out a little by providing
additional options.

An additional awkwardness is that go-cmp does all of its work at runtime
using reflection, at which point the generic types have all been erased
and lowered to many separate concrete types. Therefore we need some helper
functions to produce a dynamically representation using interface types,
cautiously exposing some internal details of these types only for go-cmp's
use.

The dynamic adapter here unfortunately means that the compiler likely
won't be able to optimize away CmpOptions in non-test builds, but we'll
accept that for now since the cost of that inert data and code is
relatively small. If it turns out to be a problem then we'll need to find
a different strategy, but hopefully not.
2024-01-08 10:52:01 -08:00
Martin Atkins
15c38a1a19 collections: Add HashiCorp copyright comments 2023-11-15 12:38:55 -08:00
Martin Atkins
094ef0a8f3 collections: Better behavior for interactions with uninit maps
Similar to the built-in map types in Go, the zero value of collections.Map
now behaves as if empty on read, and generates actionable panics when
attempting to write.
2023-11-15 12:38:55 -08:00
Martin Atkins
e4d372c490 collections: Generic Set and Map types
This is a generalization of the similar types previously implemented in
package addrs, now available for a type in any package as long as we can
write a suitable rule for calculating a unique key for each distinct value
of that type.

Hopefully these eventually get replaced by future Go standard library
functions, but this is here to fill that gap for us in the meantime.
2023-11-15 12:38:51 -08:00