mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-10 18:38:22 +00:00
21 lines
288 B
Go
21 lines
288 B
Go
package util
|
|
|
|
func ConvertSliceToSetString(slice []string) string {
|
|
if len(slice) == 0 {
|
|
return ""
|
|
} else if len(slice) == 1 {
|
|
return slice[0]
|
|
}
|
|
|
|
res := "{ "
|
|
|
|
for i := range slice {
|
|
res += " " + slice[i]
|
|
if i < len(slice)-1 {
|
|
res += ","
|
|
}
|
|
}
|
|
|
|
res += " }"
|
|
return res
|
|
}
|