mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-07 01:03:19 +00:00
Merge pull request #123969 from liangyuanpeng/cleanup_rand
cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.
This commit is contained in:
@@ -17,13 +17,10 @@ limitations under the License.
|
||||
package cache
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
@@ -17,13 +17,10 @@ limitations under the License.
|
||||
package record
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
@@ -17,13 +17,10 @@ limitations under the License.
|
||||
package workqueue
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
@@ -18,9 +18,7 @@ package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
@@ -86,7 +84,6 @@ func RunNoErrOutput(cmd *cobra.Command) error {
|
||||
}
|
||||
|
||||
func run(cmd *cobra.Command) (logsInitialized bool, err error) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
defer logs.FlushLogs()
|
||||
|
||||
cmd.SetGlobalNormalizationFunc(cliflag.WordSepNormalizeFunc)
|
||||
|
||||
Reference in New Issue
Block a user