From 95cbc56dec810009e4eb5156995d936f6d864c3d Mon Sep 17 00:00:00 2001 From: vertextau <43003542+vertextau@users.noreply.github.com> Date: Thu, 13 Feb 2020 22:42:58 +0100 Subject: [PATCH] Improve randomString func --- auth/oauth.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/auth/oauth.go b/auth/oauth.go index 54bd5137b..6e85575bf 100644 --- a/auth/oauth.go +++ b/auth/oauth.go @@ -2,6 +2,7 @@ package auth import ( "crypto/rand" + "encoding/hex" "errors" "fmt" "io" @@ -20,7 +21,7 @@ func randomString(length int) (string, error) { if err != nil { return "", err } - return fmt.Sprintf("%x", b), nil + return hex.EncodeToString(b), nil } // OAuthFlow represents the setup for authenticating with GitHub