Skip to content

Commit

Permalink
Bugfix in version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
iychoi committed Mar 8, 2023
1 parent bb1cee0 commit f2851b9
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion irods/types/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,24 @@ func (ver *IRODSVersion) GetReleaseVersion() (int, int, int) {
// HasHigherVersionThan returns if given version is higher or equal than current version
func (ver *IRODSVersion) HasHigherVersionThan(major int, minor int, patch int) bool {
smajor, sminor, spatch := ver.GetReleaseVersion()
if smajor < major || sminor < minor || spatch < patch {
if smajor > major {
return true
}
if smajor < major {
return false
}
// major is equal
if sminor > minor {
return true
}
if sminor < minor {
return false
}
// minor is equal
if spatch > patch {
return true
}
if spatch < patch {
return false
}
return true
Expand Down

0 comments on commit f2851b9

Please sign in to comment.