mirror of https://github.com/restic/restic.git
build: improve GoVersion comparison logic
Refactor AtLeast method to correctly handle version comparisons by: - Checking major version first - Handling minor version comparisons - Ensuring correct comparison of patch versions
This commit is contained in:
parent
de9a040d27
commit
74b76ca0df
12
build.go
12
build.go
|
@ -298,19 +298,21 @@ func (v GoVersion) AtLeast(other GoVersion) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
if v.Major > other.Major {
|
||||
return true
|
||||
}
|
||||
if v.Major < other.Major {
|
||||
return false
|
||||
}
|
||||
|
||||
if v.Minor > other.Minor {
|
||||
return true
|
||||
}
|
||||
if v.Minor < other.Minor {
|
||||
return false
|
||||
}
|
||||
|
||||
if v.Patch < other.Patch {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
return v.Patch >= other.Patch
|
||||
}
|
||||
|
||||
func (v GoVersion) String() string {
|
||||
|
|
Loading…
Reference in New Issue