You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
731 B

2 years ago
//go:build !debug
2 years ago
package main
import (
"encoding/json"
"log"
"math/rand"
"message-demo/config"
"message-demo/global"
"message-demo/model"
"message-demo/support"
)
// 部分代码参考: https://github.com/hb0730/auto-sign
func init() {
global.GLO_CONF_CH = make(chan model.Config)
global.GLO_CONF = config.InitialConfig()
bytes, _ := json.Marshal(global.GLO_CONF)
2 years ago
log.Println(string(bytes))
2 years ago
}
func main() {
send()
for {
2 years ago
global.GLO_CONF = <-global.GLO_CONF_CH
bytes, _ := json.Marshal(global.GLO_CONF)
log.Println(string(bytes))
send()
2 years ago
}
}
func send() {
var s support.Support
tests := []string{"test1", "test2", "test4", "test5", "test6", "test7"}
num := rand.Intn(5)
s.Name = tests[num]
s.Run()
}