From eaab2f715039e212dd67c71c30f1f8a8cfc03ded Mon Sep 17 00:00:00 2001 From: Mizuki Urushida Date: Wed, 25 Oct 2017 17:09:51 +0900 Subject: [PATCH] Fix a names-generator binary To ensure that namesgenerator binary outputs random name by initializing Seed. Signed-off-by: Mizuki Urushida not use init function. Signed-off-by: Mizuki Urushida --- pkg/namesgenerator/cmd/names-generator/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/namesgenerator/cmd/names-generator/main.go b/pkg/namesgenerator/cmd/names-generator/main.go index 18a939b70b..7fd5955beb 100644 --- a/pkg/namesgenerator/cmd/names-generator/main.go +++ b/pkg/namesgenerator/cmd/names-generator/main.go @@ -2,10 +2,13 @@ package main import ( "fmt" + "math/rand" + "time" "github.com/docker/docker/pkg/namesgenerator" ) func main() { + rand.Seed(time.Now().UnixNano()) fmt.Println(namesgenerator.GetRandomName(0)) }