Skip to content

Commit 546f07f

Browse files
authored
fix: Declare error variable and use assignment for spinner (#40)
Thanks to @mgudemann
1 parent e5b720f commit 546f07f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git/clone.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ func clone(localpath, branch, cloneurl string, auth ssh.AuthMethod, force bool,
6363
}
6464

6565
var spinner *yacspin.Spinner
66+
var err error
6667

6768
if !noSpinner {
68-
spinner, err := yacspin.New(cfg)
69+
spinner, err = yacspin.New(cfg)
6970
if err != nil {
7071
log.Debug().Err(err).Msg("cannot create spinner")
7172
}
@@ -97,7 +98,7 @@ func clone(localpath, branch, cloneurl string, auth ssh.AuthMethod, force bool,
9798
}
9899
}
99100

100-
_, err := git.PlainClone(localpath, false, &git.CloneOptions{
101+
_, err = git.PlainClone(localpath, false, &git.CloneOptions{
101102
Auth: auth,
102103
URL: cloneurl,
103104
ReferenceName: plumbing.ReferenceName("refs/heads/" + branch),

0 commit comments

Comments
 (0)