Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed Oct 20, 2023
1 parent 295d07e commit 7784875
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cmd/construct.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,19 @@ func checkIfVersionSufficient(availableVersionValue string, versionOperator stri
available := "="
// Compare up to 4 dot- or dash-separated version components.
for i := 0; i < 4; i++ {
if availableVersion[i] > requiredVersion[i] {
breakLoop := false
switch {
case availableVersion[i] > requiredVersion[i]:
available = ">"
break
} else if availableVersion[i] < requiredVersion[i] {
breakLoop = true
case availableVersion[i] < requiredVersion[i]:
available = "<"
break
} else if availableVersion[i] == requiredVersion[i] && len(requiredVersion) <= i+1 {
breakLoop = true
case availableVersion[i] == requiredVersion[i] && len(requiredVersion) <= i+1:
available = "="
breakLoop = true
}
if breakLoop {
break
}
}
Expand Down

0 comments on commit 7784875

Please sign in to comment.