Skip to content
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

Fix incorrect minVersion check - Bug here is either the function is misnamed or the logic is inverted #436

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

EliSchleifer
Copy link
Contributor

This reads to me that the current running version is at least equal to the provided version in variable 'v'. In it's current form isGoVersionAtLeast will return false when go runtime is go1.23.0 and supplied string is go1.22 (which is what is being tested for now).

I swapped the x,y to match the function name intent. I couldn't find any notes in diff if we wanted to explicitly not support 1.23 and later.

func isGoVersionAtLeast(v string) bool { return goversion.Compare(v, runtime.Version()) < 0 }

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look like it was backwards. Thank you for the fix!

@dnephin dnephin merged commit 6432e97 into gotestyourself:main Sep 17, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants