Here is my code:
package main
import (
"fmt"
"github.com/robfig/cron"
)
func main() {
c := cron.New()
c.AddFunc("@every 3m", func() { fmt.Println("Every 3 min") })
c.Start()
fmt.Println("Done")
}
The problem is when I run the code using go run
it just prints Done
then exits. I am just trying to print the function every 3 minute.