8000 Merge pull request #15 from DevotionGeo/master · Abhicodeitout/GolangTraining@51926f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 51926f4

Browse files
authored
Merge pull request GoesToEleven#15 from DevotionGeo/master
Seed the "rand".
2 parents 67f6eb2 + 4e20697 commit 51926f4

File tree

1 file changed

+1
-0
lines changed
  • 22_go-routines/06_race-condition

1 file changed

+1
-0
lines changed

22_go-routines/06_race-condition/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func main() {
1919
}
2020

2121
func incrementor(s string) {
22+
rand.Seed(time.Now().UnixNano())
2223
for i := 0; i < 20; i++ {
2324
x := counter
2425
x++

0 commit comments

Comments
 (0)
0