style: use switch/case instead of if/else

This commit is contained in:
Simon Cornet 2025-03-04 12:32:34 +01:00
commit b57c0d6336
2 changed files with 40 additions and 39 deletions

View file

@ -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)
}
}