fix: seed the random number generator
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Brian Tiger Chow committed
Dec 9, 2014 at 00:06 UTC
67802287656451cbaeebb17534edb8593e42ab51
1 file changed
+4
-1
cmd/ipfs/main.go
+4
-1
@@ -4,11 +4,13 @@ import (
4
"errors"
5
"fmt"
6
"io"
7
+ "math/rand"
8
"os"
9
"os/signal"
10
"runtime"
11
"runtime/pprof"
12
"syscall"
13
+ "time"
14
15
// TODO rm direct reference to go-logging
16
logging "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-logging"
@@ -55,7 +57,8 @@ type cmdInvocation struct {
57
// - output the response
58
// - if anything fails, print error, maybe with help
59
func main() {
58
- runtime.GOMAXPROCS(3)
60
+ rand.Seed(time.Now().UnixNano())
61
+ runtime.GOMAXPROCS(3) // FIXME rm arbitrary choice for n
62
ctx := context.Background()
63
var err error
64
var invoc cmdInvocation