1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 09:35:00 +09:00
This commit is contained in:
Kirill 2020-05-04 14:35:05 +03:00
parent 08479174b3
commit 019b9e0507
No known key found for this signature in database
GPG key ID: 52B176BB96D272ED
2 changed files with 16 additions and 3 deletions

View file

@ -1,5 +1,10 @@
package slice
import (
"math/rand"
"time"
)
func FindPos(s []string, v string) int {
for i, sv := range s {
if sv == v {
@ -29,3 +34,8 @@ func Remove(s []string, v string) []string {
}
return s[:n]
}
func GetRangomString(s []string) string {
rand.Seed(time.Now().Unix())
return s[rand.Intn(len(s))]
}