You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you so much for developing this library. While I'm trying this library, There's a problem with test, so please let me an report. I'm sorry if i was wrong.
Describe the bug
This library's go version is 1.20 (or later) according to go.mod, But context.AfterFunc is used in Connect function in paho/client.go .
To reproduce
After you switch to Go version 1.20.x and make test, you can get an error like the following.
$ go version
go version go1.20.13 linux/amd64
$ make test
go test -coverprofile /tmp/autopaho_coverage.out -race -tags=unittest ./autopaho/ -v -count 1
# github.com/eclipse/paho.golang/paho
paho/client.go:337:10: undefined: context.AfterFunc
FAIL github.com/eclipse/paho.golang/autopaho [build failed]
FAIL
make: *** [Makefile:4: unittest] Error 1
Expected behaviour
Test should be passed
Additional context
The specified Go version in this library probably is required upgrading.
Best Regards,
The text was updated successfully, but these errors were encountered:
You are correct; it does use context.AfterFunc (I introduced this in January). I probably jumped the gun by a month or so on this. It would be possible to remove the call to context.AfterFunc but doing so would complicate things a bit, so I think it's best to just move to supporting v1.21+.
I aim to support Go releases that are supported by the Go team (i.e. current version and one previous version); however I really only test with the latest release and don't update go.mod unless I notice that I'm using a new feature. Now that Go 1.22 is out, we support Go 1.21+ and, as you say, should update the go.mod to reflect this.
Update to Go version is in line with "Each
major Go release is supported until there are
two newer major releases". It's also needed
due to the use of `context.AfterFunc`.
Closeseclipse#241
Update to Go version is in line with "Each major Go release is supported until there are two newer major releases". It's also needed due to the use of `context.AfterFunc`.
Closes#241
Thank you so much for developing this library. While I'm trying this library, There's a problem with test, so please let me an report. I'm sorry if i was wrong.
Describe the bug
This library's go version is 1.20 (or later) according to go.mod, But context.AfterFunc is used in Connect function in paho/client.go .
But, context.AfterFunc is not included inGo version 1.20.x. It has been offered from version 1.21.x .
To reproduce
After you switch to Go version 1.20.x and make test, you can get an error like the following.
Expected behaviour
Test should be passed
Additional context
The specified Go version in this library probably is required upgrading.
Best Regards,
The text was updated successfully, but these errors were encountered: