diff --git a/azure/login/login.go b/azure/login/login.go index 3c13c543..dd4c63be 100644 --- a/azure/login/login.go +++ b/azure/login/login.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "log" - "math/rand" "net/url" "os/exec" "path/filepath" @@ -24,10 +23,6 @@ import ( "github.com/pkg/errors" ) -func init() { - rand.Seed(time.Now().Unix()) -} - //go login process, derived from code sample provided by MS at https://github.com/devigned/go-az-cli-stuff const ( authorizeFormat = "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?response_type=code&client_id=%s&redirect_uri=%s&state=%s&prompt=select_account&response_mode=query&scope=%s" diff --git a/cli/main.go b/cli/main.go index 110b8029..328a3a5c 100644 --- a/cli/main.go +++ b/cli/main.go @@ -30,11 +30,13 @@ package main import ( "context" "fmt" + "math/rand" "os" "os/exec" "os/signal" "path/filepath" "syscall" + "time" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -69,6 +71,8 @@ func init() { if err := os.Setenv("PATH", fmt.Sprintf("%s:%s", os.Getenv("PATH"), path)); err != nil { panic(err) } + // Seed random + rand.Seed(time.Now().UnixNano()) } func isOwnCommand(cmd *cobra.Command) bool {