Skip to content

Commit

Permalink
Replace switch with errors.Is
Browse files Browse the repository at this point in the history
  • Loading branch information
shihanng committed Jan 21, 2022
1 parent e422363 commit b367a93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ func New(path, repoSource string) (*git.Repository, error) {
Progress: ioutil.Discard,
})

switch err {
case nil:
if err == nil {
return repo, nil
case git.ErrRepositoryAlreadyExists:
default:
}

if !errors.Is(err, git.ErrRepositoryAlreadyExists) {
return nil, errors.Wrap(err, "repo: failed to clone")
}

Expand Down

0 comments on commit b367a93

Please sign in to comment.