diff options
| author | Sean Liao <sean@liao.dev> | 2023-03-10 15:39:44 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-05-24 04:09:16 +0000 |
| commit | f7341273feb9c0d7d7e12a52d975e7834bf32aa1 (patch) | |
| tree | 80d67586ad3227acf928b799c329516100fef1c2 /_content/doc/tutorial | |
| parent | da863783d71cfe08383b93adda851ac03d319c7b (diff) | |
| download | go-x-website-f7341273feb9c0d7d7e12a52d975e7834bf32aa1.tar.xz | |
_content/doc/tutorial: remove use of deprecated math/rand.Seed
Fixes golang/go#58958
Change-Id: I5ef84f2fd350e3048649cf281e8272e62b2fc052
Reviewed-on: https://go-review.googlesource.com/c/website/+/475275
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to '_content/doc/tutorial')
| -rw-r--r-- | _content/doc/tutorial/greetings-multiple-people.html | 5 | ||||
| -rw-r--r-- | _content/doc/tutorial/random-greeting.html | 7 |
2 files changed, 1 insertions, 11 deletions
diff --git a/_content/doc/tutorial/greetings-multiple-people.html b/_content/doc/tutorial/greetings-multiple-people.html index cb041591..9de0083a 100644 --- a/_content/doc/tutorial/greetings-multiple-people.html +++ b/_content/doc/tutorial/greetings-multiple-people.html @@ -73,11 +73,6 @@ func Hellos(names []string) (map[string]string, error) { return messages, nil }</ins> -// Init sets initial values for variables used in the function. -func init() { - rand.Seed(time.Now().UnixNano()) -} - // randomFormat returns one of a set of greeting messages. The returned // message is selected at random. func randomFormat() string { diff --git a/_content/doc/tutorial/random-greeting.html b/_content/doc/tutorial/random-greeting.html index 4e9a1ed6..86e580ed 100644 --- a/_content/doc/tutorial/random-greeting.html +++ b/_content/doc/tutorial/random-greeting.html @@ -51,12 +51,7 @@ func Hello(name string) (string, error) { return message, nil } -<ins>// init sets initial values for variables used in the function. -func init() { - rand.Seed(time.Now().UnixNano()) -} - -// randomFormat returns one of a set of greeting messages. The returned +<ins>// randomFormat returns one of a set of greeting messages. The returned // message is selected at random. func randomFormat() string { // A slice of message formats. |
