mirror of
https://github.com/restic/restic.git
synced 2025-03-30 00:00:14 +01:00
Merge pull request #5270 from prajwalbharadwajbm/master
build: improve GoVersion comparison logic
This commit is contained in:
commit
c405e9e748
1 changed files with 7 additions and 5 deletions
12
build.go
12
build.go
|
@ -298,19 +298,21 @@ func (v GoVersion) AtLeast(other GoVersion) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v.Major > other.Major {
|
||||||
|
return true
|
||||||
|
}
|
||||||
if v.Major < other.Major {
|
if v.Major < other.Major {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v.Minor > other.Minor {
|
||||||
|
return true
|
||||||
|
}
|
||||||
if v.Minor < other.Minor {
|
if v.Minor < other.Minor {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if v.Patch < other.Patch {
|
return v.Patch >= other.Patch
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v GoVersion) String() string {
|
func (v GoVersion) String() string {
|
||||||
|
|
Loading…
Add table
Reference in a new issue