From 699df6a3acf6867538e50931511e9dc403da108a Mon Sep 17 00:00:00 2001 From: nextzhou <nextzhou@gmail.com> Date: Thu, 27 Sep 2018 10:58:44 +0800 Subject: [PATCH 1/8] check cardinality before check subset --- threadunsafe.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/threadunsafe.go b/threadunsafe.go index 10bdd46..927eb23 100644 --- a/threadunsafe.go +++ b/threadunsafe.go @@ -76,6 +76,9 @@ func (set *threadUnsafeSet) Contains(i ...interface{}) bool { func (set *threadUnsafeSet) IsSubset(other Set) bool { _ = other.(*threadUnsafeSet) + if set.Cardinality() > other.Cardinality() { + return false + } for elem := range *set { if !other.Contains(elem) { return false From 03b572015f8e9d51f230e69f81cc8441db837606 Mon Sep 17 00:00:00 2001 From: Devendranath Thadi <devendranath.thadi3@gmail.com> Date: Thu, 12 Nov 2020 06:49:48 +0000 Subject: [PATCH 2/8] Travis-ci: added support for ppc64le and updated go versions 1.14 & 1.15 Signed-off-by: Devendranath Thadi <devendranath.thadi3@gmail.com> --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c760d24..23df098 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ language: go +arch: + - AMD64 + - ppc64le + go: - - 1.8 - - 1.9 + - 1.14 + - 1.15 - tip script: From 88d3a9269f9a0afd29a1cb042abf9414ae484dc6 Mon Sep 17 00:00:00 2001 From: Ralph Caraveo <deckarep@gmail.com> Date: Thu, 16 Dec 2021 11:06:45 -0800 Subject: [PATCH 3/8] adding mod file --- go.mod | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..7c2ff85 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/deckarep/golang-set/v2 + +go 1.17 From bcfae0b45e15387262bcbfe6607e9a3e7cf9f184 Mon Sep 17 00:00:00 2001 From: Ralph Caraveo <deckarep@gmail.com> Date: Thu, 16 Dec 2021 11:15:59 -0800 Subject: [PATCH 4/8] updating travis go versions --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 23df098..a0403c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ arch: - ppc64le go: - - 1.14 - - 1.15 + - 1.16 + - 1.17 - tip script: From fd7989e6e47f1efe922c1bab485888dca20f9774 Mon Sep 17 00:00:00 2001 From: Ralph Caraveo <deckarep@gmail.com> Date: Thu, 16 Dec 2021 11:19:11 -0800 Subject: [PATCH 5/8] only do tip and previous version of Go --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a0403c1..4b18eef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ arch: - ppc64le go: - - 1.16 - 1.17 - tip From 82e1f838bf40a41b3841820f9f9f084debad0f22 Mon Sep 17 00:00:00 2001 From: Ralph Caraveo <deckarep@gmail.com> Date: Thu, 16 Dec 2021 11:27:47 -0800 Subject: [PATCH 6/8] migrating to github workflows --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ .travis.yml | 14 -------------- 2 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b151971 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +on: [push, pull_request] +name: CI +jobs: + test: + strategy: + matrix: + go-version: [1.17.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Test + run: | + #go vet ./... + go test -race ./... + go test -bench=. diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4b18eef..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: go - -arch: - - AMD64 - - ppc64le - -go: - - 1.17 - - tip - -script: - - go test -race ./... - - go test -bench=. - From ebd0439030a56d8aebcc879544eb9de2c9969c84 Mon Sep 17 00:00:00 2001 From: Ralph Caraveo <deckarep@gmail.com> Date: Thu, 16 Dec 2021 11:40:20 -0800 Subject: [PATCH 7/8] make testing verbose --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b151971..a88fd04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,5 +17,5 @@ jobs: - name: Test run: | #go vet ./... - go test -race ./... + go test -v -race ./... go test -bench=. From 645e1ba83b7fdd0baab3f586c30a4d1619c71f99 Mon Sep 17 00:00:00 2001 From: Ralph Caraveo <deckarep@gmail.com> Date: Thu, 16 Dec 2021 12:49:45 -0800 Subject: [PATCH 8/8] fix go mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 7c2ff85..0ea813d 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/deckarep/golang-set/v2 +module github.com/deckarep/golang-set go 1.17