-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: include preview versions as fallback #674
base: main
Are you sure you want to change the base?
feat: include preview versions as fallback #674
Conversation
7347ba3
to
d05946a
Compare
} | ||
|
||
if selectedVersion != nil { | ||
deprecated = strings.EqualFold(*selectedVersion.State, VersionStateDeprecated) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated = strings.EqualFold(*selectedVersion.State, VersionStateDeprecated)
Maybe a newbie question, why do you do strings.EqualFold(...)
here and in line 1998 you do it like this?
return *v.State == VersionStateSupported
Apart from the fact that there is isPreview()
and isSupported()
, but not isDeprecated()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again a mixup of previously existing and newly written code. The difference is that EqualFold compares case-insensitive. However, I do not think this makes sense, as the predefined constants should match case-insensitve (they are part of the API contract). Therefore I remove the call to EqualFold to keep consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally I've introduced a IsDeprecated helper function as well and replaced the checks consistently with the invocation of the helper functions. This makes the code considerably clearer
d9bc14e
to
ed57cbe
Compare
6d4a9e0
to
98d2625
Compare
No description provided.