From ac91dbc29fc375d009ddfd2607f1eb2a9c54a969 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Sun, 23 Feb 2020 14:19:36 +0100 Subject: [PATCH] feat: switch to srand.Secure --- cmd/depviz/main.go | 3 ++- go.mod | 1 + go.sum | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/depviz/main.go b/cmd/depviz/main.go index 660682c93..2a1ed74d6 100644 --- a/cmd/depviz/main.go +++ b/cmd/depviz/main.go @@ -25,6 +25,7 @@ import ( "moul.io/depviz/v3/internal/dvserver" "moul.io/depviz/v3/internal/dvstore" "moul.io/godev" + "moul.io/srand" ) var ( @@ -139,7 +140,7 @@ func main() { } func globalPreRun() error { - rand.Seed(time.Now().UnixNano()) + rand.Seed(srand.Secure()) config := zap.NewDevelopmentConfig() config.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder diff --git a/go.mod b/go.mod index 12c8b38a7..2b23851ba 100644 --- a/go.mod +++ b/go.mod @@ -45,4 +45,5 @@ require ( moul.io/graphman v1.6.0 moul.io/graphman/viz v0.0.0-20200107124335-9891d9dbbff6 moul.io/multipmuri v1.13.0 + moul.io/srand v1.4.0 ) diff --git a/go.sum b/go.sum index 92dd5165c..24063423b 100644 --- a/go.sum +++ b/go.sum @@ -551,3 +551,5 @@ moul.io/graphman/viz v0.0.0-20200107124335-9891d9dbbff6 h1:qMXEnr6dZjjcFVrvlIIQM moul.io/graphman/viz v0.0.0-20200107124335-9891d9dbbff6/go.mod h1:LrMvUXoSlBip3ZXSG7mFEVrDUjEKFVtLlLbInfEoJJs= moul.io/multipmuri v1.13.0 h1:DaTEel4qaHV1BNxINkQT5hHyi/1i4ih6uEgKGVv2ASM= moul.io/multipmuri v1.13.0/go.mod h1:NinVrznZaHGUDU+4zfcL7L9WzMsHtb/kjLr4RaCbM+c= +moul.io/srand v1.4.0 h1:r5ZMiWDN0ni0lTV7KzJR/jx0K7GivJYW5WaXmufgeik= +moul.io/srand v1.4.0/go.mod h1:P2uaZB+GFstFNo8sEj6/U8FRV1n25kD0LLckFpJ+qvc=