package main import ( "fmt" "github.com/robfig/cron" ) func main() { spec := "0, 0, 0, *, *, *" c := cron.New() c.AddFunc(spec, myFunc) c.Start() select {} } func myFunc() { fmt.Println(" come here myfunc.") } // 天天凌晨0點就會調用一次callYourFunc函數