Skip to content

Commit aeb3423

Browse files
committed
mantle/kola: remove rand.Seed()
This is to appease golangci-lint: ``` Error: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. (staticcheck) ``` According to https://pkg.go.dev/math/rand#Seed "If Seed is not called, the generator is seeded randomly at program startup." so I think it's safe to just drop it.
1 parent 8c376a3 commit aeb3423

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

mantle/cmd/kola/kola.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ package main
1717
import (
1818
"encoding/json"
1919
"fmt"
20-
"math/rand"
2120
"net/http"
2221
"os"
2322
"path/filepath"
2423
"regexp"
2524
"sort"
2625
"strings"
2726
"text/tabwriter"
28-
"time"
2927

3028
"github.com/coreos/pkg/capnslog"
3129
"github.com/pkg/errors"
@@ -160,8 +158,6 @@ func init() {
160158
}
161159

162160
func main() {
163-
// initialize global state
164-
rand.Seed(time.Now().UnixNano())
165161
cli.Execute(root)
166162
}
167163

0 commit comments

Comments
 (0)