From 00f2f1a9e4b039d9aa49d2c2ecede207ed823db5 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Mon, 16 Jan 2012 14:29:26 +0100 Subject: [PATCH] Fix for Go weekly.2012-01-15. --- uniuri.go | 2 +- uniuri_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/uniuri.go b/uniuri.go index 7b6155f..c9898fd 100644 --- a/uniuri.go +++ b/uniuri.go @@ -51,7 +51,7 @@ func NewLenChars(length int, chars []byte) string { i := 0 for { if _, err := io.ReadFull(rand.Reader, r); err != nil { - panic("error reading from random source: " + err.String()) + panic("error reading from random source: " + err.Error()) } for _, c := range r { if c >= maxrb { diff --git a/uniuri_test.go b/uniuri_test.go index 9899081..e43f213 100644 --- a/uniuri_test.go +++ b/uniuri_test.go @@ -12,7 +12,7 @@ func TestNew(t *testing.T) { for _, c := range u { var present bool for _, a := range StdChars { - if int(a) == c { + if rune(a) == c { present = true } }