2015-02-12 06:54:43 -05:00
|
|
|
// extra slice functions by vypr
|
2015-01-11 21:18:20 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
func stringInSlice(a string, list []string) bool {
|
2015-01-16 15:23:31 -05:00
|
|
|
for _, b := range list {
|
|
|
|
if b == a {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
2015-01-11 21:18:20 -05:00
|
|
|
|
2015-01-16 15:23:31 -05:00
|
|
|
return false
|
2015-01-11 21:18:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func removeItemInSlice(a string, list []string) bool {
|
2015-01-16 15:23:31 -05:00
|
|
|
for c, b := range list {
|
|
|
|
if b == a {
|
|
|
|
list[c] = ""
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
2015-01-11 21:18:20 -05:00
|
|
|
|
2015-01-16 15:23:31 -05:00
|
|
|
return false
|
2015-01-11 21:18:20 -05:00
|
|
|
}
|