package services import ( "fmt" "github.com/beego/beego/v2/task" ) var blackMobile map[string]string func Task() { fmt.Println("task start") //检测未推送短信信息 checkSmsSend := task.NewTask("checkSmsSend", "0 0 */1 * * *", CheckSmsSend) task.AddTask("checkSmsSend", checkSmsSend) task.StartTask() blackMobile = make(map[string]string) blackMobile["10010"] = "10010" fmt.Println("task end") }