Closed priyamgoenka1 closed 4 months ago
hi @priyamgoenka1 can you share more about your project set-up that you are seeing this issue?
I am able to import gocron into a project running go 1.22.4 without issue. Here is an example:
module myapp
go 1.22
require github.com/go-co-op/gocron/v2 v2.7.1
require (
github.com/google/uuid v1.6.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
)
package main
import (
"fmt"
"time"
"github.com/go-co-op/gocron/v2"
)
func main() {
s, err := gocron.NewScheduler()
if err != nil {
panic(err)
}
_, err = s.NewJob(
gocron.DurationJob(
1*time.Second,
),
gocron.NewTask(
func() {
fmt.Println("job ran")
},
),
)
if err != nil {
panic(err)
}
s.Start()
select {
case <-time.After(5 * time.Second):
}
err = s.Shutdown()
if err != nil {
panic(err)
}
}
> go version
go version go1.22.4 darwin/arm64
> go run myapp/main.go
job ran
job ran
job ran
job ran
job ran
Feel free to share details, but I don't believe this is a valid bug
Describe the bug
When I tried using gocron in my microservice written in go. It threw error in building with message "note: module requires Go 1.20"
To Reproduce
Steps to reproduce the behaviour:
Version
The release version or commit SHA you're using: @latest
Expected behaviour
Are you planning to move it to latest go version as I have other dependencies on my imports due to which i have to stick to latest version.
Additional context