Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit 2b1e48b

Browse files
ovo-saxon-zerbinomike-gregory-ovo
authored andcommitted
Refactor to test contents of cache instead of slice
1 parent 673506c commit 2b1e48b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

adapters/slack/usergroup/usergroup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import (
4545
"log"
4646
"math"
4747
"os"
48-
"slices"
4948
"strings"
5049
"time"
5150

@@ -186,7 +185,8 @@ func (u *UserGroup) Add(ctx context.Context, emails []string) error {
186185
return fmt.Errorf("slack.usergroup.add.getuserbyemail(%s) -> %w", email, err)
187186
}
188187

189-
if !(slices.Contains(updatedUserGroup, user.ID)) {
188+
_, ok := u.cache[email]
189+
if !ok {
190190
// Add the new email user IDs to the list.
191191
updatedUserGroup = append(updatedUserGroup, user.ID)
192192

0 commit comments

Comments
 (0)