mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
f287e0a220
* add message to conditions Signed-off-by: Jim Bugwadia <jim@nirmata.com> * add tests Signed-off-by: Jim Bugwadia <jim@nirmata.com> * extend tests Signed-off-by: Jim Bugwadia <jim@nirmata.com> --------- Signed-off-by: Jim Bugwadia <jim@nirmata.com>
20 lines
287 B
Go
20 lines
287 B
Go
package strings
|
|
|
|
import "strings"
|
|
|
|
func JoinNonEmpty(elems []string, sep string) string {
|
|
var bldr strings.Builder
|
|
var idx int = 0
|
|
for _, s := range elems {
|
|
if s != "" {
|
|
if idx > 0 {
|
|
bldr.WriteString(sep)
|
|
}
|
|
|
|
bldr.WriteString(s)
|
|
idx++
|
|
}
|
|
}
|
|
|
|
return bldr.String()
|
|
}
|