1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-29 15:55:33 +00:00

Enumerate possible get_link responses

This commit is contained in:
Kane York 2015-10-24 22:38:04 -07:00
parent 9a1d1b720d
commit 93c3f6f672
8 changed files with 247 additions and 98 deletions

34
socketserver/lib/utils.go Normal file
View file

@ -0,0 +1,34 @@
package lib
import (
)
func AddToSliceS(ary *[]string, val string) {
slice := *ary
for _, v := range slice {
if v == val {
return
}
}
slice = append(slice, val)
*ary = slice
}
func RemoveFromSliceS(ary *[]string, val string) {
slice := *ary
var idx int = -1
for i, v := range slice {
if v == val {
idx = i
break
}
}
if idx == -1 {
return
}
slice[idx] = slice[len(slice) - 1]
slice = slice[:len(slice) - 1]
*ary = slice
}