使用定时器 使用这种方式 go function() func function() { // TODO 具体逻辑 // 每5分钟执行一次 time.AfterFunc(5*time.Minute, function) }