Skip to content

Commit 424eb11

Browse files
authored
Remove unnecessary random seed initialization. (open-cluster-management-io#820)
Signed-off-by: xuezhaojun <[email protected]>
1 parent b2a7109 commit 424eb11

File tree

5 files changed

+0
-20
lines changed

5 files changed

+0
-20
lines changed

cmd/addon/main.go

-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ package main
33
import (
44
goflag "flag"
55
"fmt"
6-
"math/rand"
76
"os"
8-
"time"
97

108
"github.com/spf13/cobra"
119
"github.com/spf13/pflag"
@@ -17,8 +15,6 @@ import (
1715
)
1816

1917
func main() {
20-
rand.Seed(time.Now().UTC().UnixNano())
21-
2218
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
2319
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
2420

cmd/placement/main.go

-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ package main
33
import (
44
goflag "flag"
55
"fmt"
6-
"math/rand"
76
"os"
8-
"time"
97

108
"github.com/spf13/cobra"
119
"github.com/spf13/pflag"
@@ -17,8 +15,6 @@ import (
1715
)
1816

1917
func main() {
20-
rand.Seed(time.Now().UTC().UnixNano())
21-
2218
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
2319
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
2420

cmd/registration-operator/main.go

-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ package main
33
import (
44
goflag "flag"
55
"fmt"
6-
"math/rand"
76
"os"
8-
"time"
97

108
"github.com/spf13/cobra"
119
"github.com/spf13/pflag"
@@ -18,8 +16,6 @@ import (
1816
)
1917

2018
func main() {
21-
rand.Seed(time.Now().UTC().UnixNano())
22-
2319
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
2420
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
2521

cmd/registration/main.go

-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ package main
33
import (
44
goflag "flag"
55
"fmt"
6-
"math/rand"
76
"os"
8-
"time"
97

108
"github.com/spf13/cobra"
119
"github.com/spf13/pflag"
@@ -26,8 +24,6 @@ import (
2624
// registration API and the spoke agent.
2725

2826
func main() {
29-
rand.Seed(time.Now().UTC().UnixNano())
30-
3127
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
3228
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
3329

cmd/work/main.go

-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ package main
33
import (
44
goflag "flag"
55
"fmt"
6-
"math/rand"
76
"os"
8-
"time"
97

108
"github.com/spf13/cobra"
119
"github.com/spf13/pflag"
@@ -23,8 +21,6 @@ import (
2321
)
2422

2523
func main() {
26-
rand.Seed(time.Now().UTC().UnixNano())
27-
2824
pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
2925
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
3026

0 commit comments

Comments
 (0)