summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-15 17:08:36 -0600
committermo khan <mo@mokhan.ca>2025-05-15 17:08:36 -0600
commit77afd54f19a5c7ad4417c4db687e257900b0e6c3 (patch)
tree1c41b2e9e5fc3c5eb34c2fe53a6255592de592ca /vendor
parent1622cea8df335a605ed815c6753cdefe8d2147ad (diff)
chore: update golang-set module
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/deckarep/golang-set/v2/README.md5
-rw-r--r--vendor/github.com/deckarep/golang-set/v2/set.go14
-rw-r--r--vendor/github.com/deckarep/golang-set/v2/threadsafe.go13
-rw-r--r--vendor/github.com/deckarep/golang-set/v2/threadunsafe.go20
-rw-r--r--vendor/modules.txt2
5 files changed, 53 insertions, 1 deletions
diff --git a/vendor/github.com/deckarep/golang-set/v2/README.md b/vendor/github.com/deckarep/golang-set/v2/README.md
index bb691b1..e471368 100644
--- a/vendor/github.com/deckarep/golang-set/v2/README.md
+++ b/vendor/github.com/deckarep/golang-set/v2/README.md
@@ -9,6 +9,11 @@ The missing `generic` set collection for the Go language. Until Go has sets bui
## Psst
* Hi there, 👋! Do you use or have interest in the [Zig programming language](https://ziglang.org/) created by Andrew Kelley? If so, the golang-set project has a new sibling project: [ziglang-set](https://github.com/deckarep/ziglang-set)! Come check it out!
+## Update 3/14/2025
+* Packaged version: `2.8.0` introduces support for true iterators for Go 1.23+. Please see [issue #141](https://github.com/deckarep/golang-set/issues/141)
+for further details on the implications of how iterations work between older Go versions vs newer Go versions. Additionally, this
+release has a minor unit-test spelling fix.
+
## Update 12/3/2024
* Packaged version: `2.7.0` fixes a long-standing bug with *JSON Unmarshaling*. A large refactor in the interest of performance
introduced this bug and there was no way around it but to revert the code back to how it was previously. The performance
diff --git a/vendor/github.com/deckarep/golang-set/v2/set.go b/vendor/github.com/deckarep/golang-set/v2/set.go
index 292089d..e9409aa 100644
--- a/vendor/github.com/deckarep/golang-set/v2/set.go
+++ b/vendor/github.com/deckarep/golang-set/v2/set.go
@@ -73,6 +73,10 @@ type Set[T comparable] interface {
// given items are in the set.
ContainsAny(val ...T) bool
+ // ContainsAnyElement returns whether at least one of the
+ // given element are in the set.
+ ContainsAnyElement(other Set[T]) bool
+
// Difference returns the difference between this set
// and other. The returned set will contain
// all elements of this set that are not also
@@ -253,3 +257,13 @@ func NewThreadUnsafeSetFromMapKeys[T comparable, V any](val map[T]V) Set[T] {
return s
}
+
+// Elements returns an iterator that yields the elements of the set. Starting
+// with Go 1.23, users can use a for loop to iterate over it.
+func Elements[T comparable](s Set[T]) func(func(element T) bool) {
+ return func(yield func(element T) bool) {
+ s.Each(func(t T) bool {
+ return !yield(t)
+ })
+ }
+}
diff --git a/vendor/github.com/deckarep/golang-set/v2/threadsafe.go b/vendor/github.com/deckarep/golang-set/v2/threadsafe.go
index 93f20c8..664fc61 100644
--- a/vendor/github.com/deckarep/golang-set/v2/threadsafe.go
+++ b/vendor/github.com/deckarep/golang-set/v2/threadsafe.go
@@ -82,6 +82,19 @@ func (t *threadSafeSet[T]) ContainsAny(v ...T) bool {
return ret
}
+func (t *threadSafeSet[T]) ContainsAnyElement(other Set[T]) bool {
+ o := other.(*threadSafeSet[T])
+
+ t.RLock()
+ o.RLock()
+
+ ret := t.uss.ContainsAnyElement(o.uss)
+
+ t.RUnlock()
+ o.RUnlock()
+ return ret
+}
+
func (t *threadSafeSet[T]) IsEmpty() bool {
return t.Cardinality() == 0
}
diff --git a/vendor/github.com/deckarep/golang-set/v2/threadunsafe.go b/vendor/github.com/deckarep/golang-set/v2/threadunsafe.go
index 7e3243b..c95d32b 100644
--- a/vendor/github.com/deckarep/golang-set/v2/threadunsafe.go
+++ b/vendor/github.com/deckarep/golang-set/v2/threadunsafe.go
@@ -109,6 +109,26 @@ func (s *threadUnsafeSet[T]) ContainsAny(v ...T) bool {
return false
}
+func (s *threadUnsafeSet[T]) ContainsAnyElement(other Set[T]) bool {
+ o := other.(*threadUnsafeSet[T])
+
+ // loop over smaller set
+ if s.Cardinality() < other.Cardinality() {
+ for elem := range *s {
+ if o.contains(elem) {
+ return true
+ }
+ }
+ } else {
+ for elem := range *o {
+ if s.contains(elem) {
+ return true
+ }
+ }
+ }
+ return false
+}
+
// private version of Contains for a single element v
func (s *threadUnsafeSet[T]) contains(v T) (ok bool) {
_, ok = (*s)[v]
diff --git a/vendor/modules.txt b/vendor/modules.txt
index f04cbea..3d0f8be 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -36,7 +36,7 @@ github.com/cpuguy83/dockercfg
# github.com/davecgh/go-spew v1.1.1
## explicit
github.com/davecgh/go-spew/spew
-# github.com/deckarep/golang-set/v2 v2.7.0
+# github.com/deckarep/golang-set/v2 v2.8.0
## explicit; go 1.18
github.com/deckarep/golang-set/v2
# github.com/distribution/reference v0.6.0