style: use switch/case instead of if/else
This commit is contained in:
parent
b1883bad73
commit
b57c0d6336
2 changed files with 40 additions and 39 deletions
|
|
@ -94,9 +94,12 @@ func pullRepository(repoName string, repoDestination string) {
|
|||
if err != nil {
|
||||
errorCount = errorCount + 1
|
||||
pulledCount = pulledCount - 1
|
||||
if strings.Contains(string(pullOutput), "You have unstaged changes") {
|
||||
|
||||
switch {
|
||||
case strings.Contains(string(pullOutput), "You have unstaged changes"):
|
||||
pullErrorMsg = append(pullErrorMsg, repoDestination)
|
||||
} else {
|
||||
|
||||
default:
|
||||
log.Printf("pull error: %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue