Skip to content

Commit 10ea161

Browse files
author
Nate Smith
authored
Merge pull request cli#428 from vertextau/oauth-fix
Improve randomString function
2 parents 96dc437 + 95cbc56 commit 10ea161

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

auth/oauth.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package auth
22

33
import (
44
"crypto/rand"
5+
"encoding/hex"
56
"errors"
67
"fmt"
78
"io"
@@ -20,7 +21,7 @@ func randomString(length int) (string, error) {
2021
if err != nil {
2122
return "", err
2223
}
23-
return fmt.Sprintf("%x", b), nil
24+
return hex.EncodeToString(b), nil
2425
}
2526

2627
// OAuthFlow represents the setup for authenticating with GitHub

0 commit comments

Comments
 (0)