refact(action): Make ActionSet behave as a set instead of a list
This switches the implementation of an ActionSet from a slice to a map to ensure the elements in an ActionSet are unique. This allows for other packages to perform set operations such as a union or difference without needing to account for duplicates.
This commit is contained in:
52 files changed
+1401
-274
No files matched your search
@@ -146,6 +146,9 @@ func TestList_Plugin(t *testing.T) {
|
||||
comparableSetSlice(ul.Items),
|
||||
cmpopts.IgnoreUnexported(hostsets.HostSet{}),
|
||||
cmpopts.IgnoreFields(hostsets.HostSet{}, "Version", "UpdatedTime"),
|
||||
cmpopts.SortSlices(func(a, b string) bool {
|
||||
return a < b
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -165,6 +168,9 @@ func TestList_Plugin(t *testing.T) {
|
||||
cmpopts.SortSlices(func(x, y *hostsets.HostSet) bool {
|
||||
return x.Id < y.Id
|
||||
}),
|
||||
cmpopts.SortSlices(func(a, b string) bool {
|
||||
return a < b
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user