Skip to content

Commit bd05a95

Browse files
[occm] Reintroduce seeding of math/rand source (kubernetes#2121)
* [occm] Revert seeding of math/rand source In Go v1.20, `rand.Seed` is deprecated and `math/rand`'s is automatically seeded. However, that doesn't happen in Go v1.19 that is used to build this branch. With this commit, the global source for `math/rand` is seeded again in `main.go`. * go-lint: Upgrade staticcheck to v0.4.2 which handles deprecations more gracefully.
1 parent 1bf5a4a commit bd05a95

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ build-cmd-%: work $(SOURCES)
155155
test: unit functional
156156

157157
check: work
158-
go run github.com/golangci/golangci-lint/cmd/[email protected].1 run ./...
158+
go run github.com/golangci/golangci-lint/cmd/[email protected].2 run ./...
159159

160160
unit: work
161161
go test -tags=unit $(shell go list ./... | sed -e '/sanity/ { N; d; }' | sed -e '/tests/ {N; d;}') $(TESTARGS)

cmd/openstack-cloud-controller-manager/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import (
4444
)
4545

4646
func main() {
47-
rand.NewSource(time.Now().UnixNano())
47+
rand.Seed(time.Now().UnixNano())
4848

4949
ccmOptions, err := options.NewCloudControllerManagerOptions()
5050
if err != nil {

0 commit comments

Comments
 (0)