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
766 B
41 lines
766 B
2 years ago
|
//go:build debug
|
||
|
|
||
|
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)
|
||
|
log.Println(string(bytes))
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
send()
|
||
|
for {
|
||
|
global.GLO_CONF = <-global.GLO_CONF_CH
|
||
|
bytes, _ := json.Marshal(global.GLO_CONF)
|
||
|
log.Println(string(bytes))
|
||
|
send()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func send() {
|
||
|
var s support.Support
|
||
|
tests := []string{"debug_test1", "debug_test2", "debug_test4", "debug_test5", "debug_test6", "debug_test7"}
|
||
|
num := rand.Intn(5)
|
||
|
s.Name = tests[num]
|
||
|
s.Run()
|
||
|
}
|