From 67802287656451cbaeebb17534edb8593e42ab51 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Tue, 9 Dec 2014 00:06:53 -0800 Subject: [PATCH] fix: seed the random number generator License: MIT Signed-off-by: Brian Tiger Chow --- cmd/ipfs/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index 18923a64a..c6a48fa45 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -4,11 +4,13 @@ import ( "errors" "fmt" "io" + "math/rand" "os" "os/signal" "runtime" "runtime/pprof" "syscall" + "time" // TODO rm direct reference to go-logging logging "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-logging" @@ -55,7 +57,8 @@ type cmdInvocation struct { // - output the response // - if anything fails, print error, maybe with help func main() { - runtime.GOMAXPROCS(3) + rand.Seed(time.Now().UnixNano()) + runtime.GOMAXPROCS(3) // FIXME rm arbitrary choice for n ctx := context.Background() var err error var invoc cmdInvocation