Skip to content

Commit a0b8818

Browse files
dkhalizovTom Moulard
authored andcommitted
remove slices usage
related to #120
1 parent c4d892d commit a0b8818

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/notifications/service.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package notifications
44
import (
55
"log"
66
"net/http"
7-
"slices"
87
"time"
98
)
109

@@ -22,12 +21,13 @@ func (s *Service) addNotifier(n notifier) {
2221
}
2322

2423
func (s *Service) Notify(event Event) {
25-
if !slices.Contains(s.allowedTypes, string(event.Type)) {
26-
// event type not enabled
27-
return
28-
}
24+
for _, allowedType := range s.allowedTypes {
25+
if string(event.Type) == allowedType {
26+
s.ch <- event
2927

30-
s.ch <- event
28+
return
29+
}
30+
}
3131
}
3232

3333
func (s *Service) Run() {

0 commit comments

Comments
 (0)