-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: Go version 1.10 will introduce problems when comparing versions #23553
Comments
Have you filed a bug against goconvey? |
What action do you suggest we take? |
There are many possibilities to provide a better API to decrease the burden on developers and thus the likeliness of errors. I don't want to bike-shed but off the top my mind a few options are:
One of the problems is that versions strings are always (probably inherently) underspecified so it's hard to write future-proof code. I submitted a recent CL that was parsing a Darwin version string in the runtime, and since I have no clue how Apple might decide to evolve that string, the code is really fragile. |
You can check compile-time tags at run time today by looking at A string based version comparison API doesn't make sense to me. How will people know what to pass? The problem with Perhaps the problem is doing a run time version check in the first place. The code above from goconvey could be implemented reliably using build tags. |
I can't see
|
The design discussion around |
SGTM. Closing as dup. Thanks. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.10beta2
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?independent of OS/ CPU
What did you do?
Run goconvey (https://github.com/smartystreets/goconvey) on my current go project
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
No warning (same as Go 1.9)
What did you see instead?
2018/01/25 17:05:47 goconvey.go:210: Go version is less that 1.2 (go1.10beta2), please upgrade to the latest stable version to enable coverage reporting.
Agreed that the method to compare versions is suboptimal:
but i did not find a way to extract this information from runtime's func Version() string, other than importing a full blown lib such as hashicorp/go-version.
I am aware of #11972 (Open), #21207 (Closed), and #21209 (Closed).
The text was updated successfully, but these errors were encountered: