Fix condition; remove unreachable panic.
Dmitry Chestnykh dmitry@codingrobots.com
Sat, 09 Aug 2014 16:05:42 +0200
1 files changed,
1 insertions(+),
2 deletions(-)
jump to
M
random.go
→
random.go
@@ -78,7 +78,7 @@ i := 0
for { r := randomBytes(length + (length / 4)) for _, c := range r { - if c >= maxrb { + if c > maxrb { // Skip this number to avoid modulo bias. continue }@@ -89,7 +89,6 @@ return
} } } - panic("unreachable") } // randomId returns a new random id string.