From 213abebf0acc0a414a61d07a8afb17ce98bb4e3d Mon Sep 17 00:00:00 2001 From: nxshock Date: Mon, 22 Jul 2019 22:28:55 +0500 Subject: [PATCH] Remove error check for token generator --- internal/backends/memory/tokens.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/backends/memory/tokens.go b/internal/backends/memory/tokens.go index 0d5b0e3..7714b35 100644 --- a/internal/backends/memory/tokens.go +++ b/internal/backends/memory/tokens.go @@ -8,10 +8,7 @@ import ( // newToken returns new generated token with specified length func newToken(size int) string { b := make([]byte, size) - _, err := rand.Read(b) - if err != nil { - panic(err) - } + rand.Read(b) // TODO: check may be can be error return fmt.Sprintf("%x", b) }