This commit is contained in:
2022-05-17 01:56:44 +03:00
commit 3a9b8c8468
117 changed files with 7175 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
package main
import (
"os"
"time"
"fmt"
"encoding/json"
"math/rand"
)
var (
s rand.Source
r *rand.Rand
)
func init() {
s = rand.NewSource(time.Now().Unix())
r = rand.New(s)
}
func main() {
var hosts []string
if err := json.Unmarshal([]byte(os.Getenv("URLS")), &hosts); err != nil {
fmt.Printf("unmarshal json: %v", err)
os.Exit(1)
}
if l := len(hosts); l > 0 {
fmt.Println(hosts[r.Intn(l)])
}
}