feat(filters): validate existence of external exec cmd (#1501)

* feat(filters): check external cmd exists

* fix: imports

* Update internal/domain/filter.go

---------

Co-authored-by: s0up4200 <soup@r4tio.dev>
This commit is contained in:
ze0s 2024-04-12 13:56:57 +02:00 committed by GitHub
parent b44d55ea55
commit da53230077
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 84 additions and 8 deletions

View file

@ -6,3 +6,14 @@ func String(str string) string {
str = strings.TrimSpace(str)
return str
}
func FilterString(str string) string {
str = strings.TrimSpace(str)
str = strings.Trim(str, ",")
// replace newline with comma
str = strings.ReplaceAll(str, "\n", ",")
str = strings.ReplaceAll(str, ",,", ",")
return str
}