blob: 296f169fb3f189df76938c1f0783590f034504a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
package common
import "strings"
// KeywordsCheck - check if one of the keyword from the <keywords> group is included in the
// <line> string. Returns false if no word was found, or true otherwise and also this word
// itself
func KeywordsCheck(line string, keywords ...string) (bool, string) {
for _, key := range keywords {
if strings.Contains(line, key) {
return true, key
}
}
return false, ""
}
|