Commit f94b5a81 authored by Agniva De Sarker's avatar Agniva De Sarker Committed by Rob Pike

math/rand: clarify documentation for Seed example

Fixes #25325

Change-Id: I101641be99a820722edb7272918e04e8d2e1646c
Reviewed-on: https://go-review.googlesource.com/112775Reviewed-by: 's avatarRob Pike <r@golang.org>
parent e6a9335c
......@@ -16,7 +16,10 @@ import (
// the output of the random number generator when given a fixed seed.
func Example() {
rand.Seed(42) // Try changing this number!
// Seeding with the same value results in the same random sequence each run.
// For different numbers, seed with a different value, such as
// time.Now().UnixNano(), which yields a constantly-changing number.
rand.Seed(42)
answers := []string{
"It is certain",
"It is decidedly so",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment