Skip to content

Commit

Permalink
use switch instead of if-else statements for fixing the warning from …
Browse files Browse the repository at this point in the history
…Codebeat.
  • Loading branch information
tamada committed Mar 15, 2019
1 parent dc20581 commit f57f923
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions clone/clone_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ func (clone *CloneCommand) perform(db *common.Database, arguments []string) int
}

func printResult(count int, dest string, group string) {
if count == 1 {
switch count {
case 0:
fmt.Println("no repositories cloned")
case 1:
fmt.Printf("a repository cloned into %s and registered to group %s\n", dest, group)
} else if count > 1 {
default:
fmt.Printf("%d repositories cloned into %s and registered to group %s\n", count, dest, group)
} else if count == 0 {
fmt.Println("no repositories cloned")
}
}

Expand Down

0 comments on commit f57f923

Please sign in to comment.