Skip to content

Commit 98f491a

Browse files
HerrSubsetPieter-Jan Smets
authored andcommitted
Remove random.Seed() call from robot-name's approach file
From the Go documentation on random.Seed(): Deprecated: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator.
1 parent ac0d232 commit 98f491a

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

exercises/practice/robot-name/.approaches/introduction.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func generateRobotNames() []string {
4848
}
4949
}
5050

51-
rand.Seed(time.Now().UnixNano())
5251
rand.Shuffle(len(names), func(i, j int) { names[i], names[j] = names[j], names[i] })
5352
return names
5453
}

exercises/practice/robot-name/.approaches/shuffle/content.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ func generateRobotNames() []string {
3535
}
3636
}
3737

38-
rand.Seed(time.Now().UnixNano())
3938
rand.Shuffle(len(names), func(i, j int) { names[i], names[j] = names[j], names[i] })
4039
return names
4140
}

0 commit comments

Comments
 (0)