Remove error check for token generator

This commit is contained in:
nxshock 2019-07-22 22:28:55 +05:00
parent 4ad7285103
commit 213abebf0a

View File

@ -8,10 +8,7 @@ import (
// newToken returns new generated token with specified length // newToken returns new generated token with specified length
func newToken(size int) string { func newToken(size int) string {
b := make([]byte, size) b := make([]byte, size)
_, err := rand.Read(b) rand.Read(b) // TODO: check may be can be error
if err != nil {
panic(err)
}
return fmt.Sprintf("%x", b) return fmt.Sprintf("%x", b)
} }