From: Jeff Halter Date: Mon, 6 Jun 2022 15:36:18 +0000 (-0700) Subject: Seed the random number generator X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/93df4153a2028e7c6ffee0d005f58db8cec9917a?ds=sidebyside Seed the random number generator --- diff --git a/cmd/mobius-hotline-server/main.go b/cmd/mobius-hotline-server/main.go index aa1f015..285f67b 100644 --- a/cmd/mobius-hotline-server/main.go +++ b/cmd/mobius-hotline-server/main.go @@ -7,7 +7,9 @@ import ( "github.com/jhalter/mobius/hotline" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "math/rand" "os" + "time" ) const ( @@ -16,6 +18,8 @@ const ( ) func main() { + rand.Seed(time.Now().UnixNano()) + ctx, cancelRoot := context.WithCancel(context.Background()) basePort := flag.Int("bind", defaultPort, "Bind address and port")