This commit is contained in:
2023-02-02 06:08:50 -06:00
parent e0affc82d4
commit 5ff74e851c
5 changed files with 183 additions and 118 deletions

View File

@@ -441,3 +441,9 @@ func StringSliceContains(sl []string, val string) bool {
}
return false
}
func AppendStringIfDistinct(sl []string, val string) []string {
if !StringSliceContains(sl, val) {
return append(sl, val)
}
return sl
}