Permalink
Browse files

Fix a names-generator binary

To ensure that namesgenerator binary outputs random name
by initializing Seed.

Signed-off-by: Mizuki Urushida <z11111001011@gmail.com>

not use init function.

Signed-off-by: Mizuki Urushida <z11111001011@gmail.com>
  • Loading branch information...
zuiurs committed Oct 25, 2017
1 parent d85f5e7 commit eaab2f715039e212dd67c71c30f1f8a8cfc03ded
Showing with 3 additions and 0 deletions.
  1. +3 −0 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))
}

0 comments on commit eaab2f7

Please sign in to comment.