You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
315 B
22 lines
315 B
package utils
|
|
|
|
func RemoveDuplicateStrings(s []string) []string {
|
|
keys := make(map[string]bool)
|
|
o := []string{}
|
|
|
|
for _, e := range s {
|
|
if _, v := keys[e]; !v {
|
|
keys[e] = true
|
|
o = append(o, e)
|
|
}
|
|
}
|
|
return o
|
|
}
|
|
|
|
func PluralizeString(s string, i int) string {
|
|
if i == 1 {
|
|
return s
|
|
}
|
|
return s + "s"
|
|
}
|