Darien Raymond 9 лет назад
Родитель
Сommit
1a10f7c4da
2 измененных файлов с 6 добавлено и 1 удалено
  1. 5 0
      common/dice/dice.go
  2. 1 1
      common/net/testing/port.go

+ 5 - 0
common/dice/dice.go

@@ -2,6 +2,7 @@ package dice
 
 import (
 	"math/rand"
+	"time"
 )
 
 func Roll(n int) int {
@@ -10,3 +11,7 @@ func Roll(n int) int {
 	}
 	return rand.Intn(n)
 }
+
+func init() {
+	rand.Seed(time.Now().Unix())
+}

+ 1 - 1
common/net/testing/port.go

@@ -6,5 +6,5 @@ import (
 )
 
 func PickPort() v2net.Port {
-	return v2net.Port(30000 + dice.Roll(10000))
+	return v2net.Port(30000 + dice.Roll(5000))
 }