diff options
Diffstat (limited to 'util/intelp2m/platforms/common/template.go')
-rw-r--r-- | util/intelp2m/platforms/common/template.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/util/intelp2m/platforms/common/template.go b/util/intelp2m/platforms/common/template.go new file mode 100644 index 0000000000..296f169fb3 --- /dev/null +++ b/util/intelp2m/platforms/common/template.go @@ -0,0 +1,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, "" +} |