gracefull shutdown for unresolvable errors

This commit is contained in:
2025-03-07 21:40:53 +07:00
parent 2fd8b20b77
commit e6f21d1bb2
19 changed files with 181 additions and 133 deletions

View File

@@ -2,14 +2,14 @@ package utils
import "strings"
func ContainsMany(str string, substrs... string) bool {
count := 0
for _, substr := range substrs {
func ContainsMany(str string, substrings ...string) bool {
var matches int
for _, substr := range substrings {
if strings.Contains(str, substr) {
count++;
matches++
} else {
return false;
return false
}
}
return count == len(substrs)
}
return matches == len(substrings)
}