Add support for multiple policies (#16)

Change policy annotation to support comma-separated list of policies.

---------

Co-authored-by: Maycon Santos <mlsmaycon@gmail.com>
This commit is contained in:
M. Essam
2025-03-28 13:50:09 +01:00
committed by GitHub
co-authored by Maycon Santos
parent 6a33bffb65
commit 219ee9a0b6
6 changed files with 250 additions and 93 deletions
+15
View File
@@ -1,5 +1,7 @@
package util
import "strings"
// Contains return if y is in slice x
func Contains[T comparable](x []T, y T) bool {
for _, v := range x {
@@ -39,3 +41,16 @@ func Equivalent[T comparable](x, y []T) bool {
return true
}
// SplitTrim split string and trim whitespace
func SplitTrim(str, sep string) []string {
if len(str) == 0 {
return nil
}
sp := strings.Split(str, sep)
ret := make([]string, 0, len(sp))
for _, v := range sp {
ret = append(ret, strings.TrimSpace(v))
}
return ret
}