mirror of
https://github.com/coaidev/coai.git
synced 2025-05-19 21:10:18 +09:00
13 lines
175 B
Go
13 lines
175 B
Go
package utils
|
|
|
|
import (
|
|
"math/rand"
|
|
"strings"
|
|
)
|
|
|
|
func GetRandomKey(apikey string) string {
|
|
arr := strings.Split(apikey, "|")
|
|
idx := rand.Intn(len(arr))
|
|
return arr[idx]
|
|
}
|