diff options
Diffstat (limited to 'src/pkg/crypto/rand/example_test.go')
-rw-r--r-- | src/pkg/crypto/rand/example_test.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pkg/crypto/rand/example_test.go b/src/pkg/crypto/rand/example_test.go index 5af8e46f5..8a2717300 100644 --- a/src/pkg/crypto/rand/example_test.go +++ b/src/pkg/crypto/rand/example_test.go @@ -8,7 +8,6 @@ import ( "bytes" "crypto/rand" "fmt" - "io" ) // This example reads 10 cryptographically secure pseudorandom numbers from @@ -16,8 +15,8 @@ import ( func ExampleRead() { c := 10 b := make([]byte, c) - n, err := io.ReadFull(rand.Reader, b) - if n != len(b) || err != nil { + _, err := rand.Read(b) + if err != nil { fmt.Println("error:", err) return } |