cronticker
implements a ticker that works with crontab schedules.
go get github.com/martin-viggiano/cronticker
Go doc: https://pkg.go.dev/github.com/martin-viggiano/cronticker
import (
"log"
"github.com/martin-viggiano/cronticker"
)
func main() {
ticker, err := cronticker.NewTicker("5 4 * * *")
if err != nil {
log.Fatal("failed to create ticker")
}
defer ticker.Stop()
select {
case <-ticker.C:
log.Print("it is 04:05")
}
err = ticker.Reset("5 4 * * *")
}