From 39b527691495902279da7ac8405a070ded7dd4a2 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 7 Jul 2020 09:07:16 -0400 Subject: net: remove dependency on math/rand Like we did for sync, let the runtime give net random numbers, to avoid forcing an import of math/rand for DNS. Change-Id: Iab3e64121d687d288a3961a8ccbcebe589047253 Reviewed-on: https://go-review.googlesource.com/c/go/+/241258 Trust: Russ Cox Run-TryBot: Russ Cox TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- src/net/dnsclient_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/net/dnsclient_test.go') diff --git a/src/net/dnsclient_test.go b/src/net/dnsclient_test.go index f3ed62db36..24cd69e13b 100644 --- a/src/net/dnsclient_test.go +++ b/src/net/dnsclient_test.go @@ -5,7 +5,6 @@ package net import ( - "math/rand" "testing" ) @@ -17,7 +16,7 @@ func checkDistribution(t *testing.T, data []*SRV, margin float64) { results := make(map[string]int) - count := 1000 + count := 10000 for j := 0; j < count; j++ { d := make([]*SRV, len(data)) copy(d, data) @@ -39,7 +38,6 @@ func checkDistribution(t *testing.T, data []*SRV, margin float64) { } func testUniformity(t *testing.T, size int, margin float64) { - rand.Seed(1) data := make([]*SRV, size) for i := 0; i < size; i++ { data[i] = &SRV{Target: string('a' + rune(i)), Weight: 1} @@ -55,7 +53,6 @@ func TestDNSSRVUniformity(t *testing.T) { } func testWeighting(t *testing.T, margin float64) { - rand.Seed(1) data := []*SRV{ {Target: "a", Weight: 60}, {Target: "b", Weight: 30}, -- cgit v1.2.1