diff --git a/app/main.go b/app/main.go index 94c59d0..5190731 100644 --- a/app/main.go +++ b/app/main.go @@ -416,7 +416,6 @@ func makeSSLConfig() (config proxy.SSLConfig, err error) { func makeLBSelector() func(len int) int { switch opts.LBType { case "random": - rand.Seed(time.Now().UnixNano()) return rand.Intn case "failover": return func(int) int { return 0 } // dead server won't be in the list, we can safely pick the first one diff --git a/app/main_test.go b/app/main_test.go index 8b1b066..cf41407 100644 --- a/app/main_test.go +++ b/app/main_test.go @@ -156,7 +156,6 @@ func Test_MainWithSSL(t *testing.T) { } func Test_MainWithPlugin(t *testing.T) { - rand.Seed(time.Now().UnixNano()) proxyPort := rand.Intn(10000) + 40000 conductorPort := rand.Intn(10000) + 40000 os.Args = []string{"test", "--static.enabled", @@ -329,7 +328,7 @@ func waitForHTTPServerStart(port int) { type TestPlugin struct{} -//nolint +// nolint func (h *TestPlugin) HeaderThing(req *lib.Request, res *lib.Response) (err error) { log.Printf("req: %+v", req) res.HeadersIn = http.Header{} @@ -340,7 +339,7 @@ func (h *TestPlugin) HeaderThing(req *lib.Request, res *lib.Response) (err error return nil } -//nolint +// nolint func (h *TestPlugin) ErrorThing(req lib.Request, res *lib.Response) (err error) { log.Printf("req: %+v", req) if req.URL == "/fail" { diff --git a/app/plugin/conductor_test.go b/app/plugin/conductor_test.go index 8836700..9dcb1ee 100644 --- a/app/plugin/conductor_test.go +++ b/app/plugin/conductor_test.go @@ -318,7 +318,6 @@ func TestConductor_MiddlewarePluginBadStatus(t *testing.T) { }, } - rand.Seed(time.Now().UnixNano()) port := rand.Intn(30000) c := Conductor{RPCDialer: dialer, Address: "127.0.0.1:" + strconv.Itoa(30000+port)}