From 745276fe6e2b81570e5c84625699d632da5fd6a9 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 14 Dec 2025 11:38:45 +0100 Subject: Drop deprecated rand.Seed calls $ staticcheck --version staticcheck 2025.1.1 (0.6.1) $ staticcheck ./... contrib/findholes/holes/holes.go:179:2: 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. (SA1019) tests/defaults/acl_test.go:24:2: 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. (SA1019) tests/plaintextnames/file_holes_test.go:143:2: 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. (SA1019) --- tests/defaults/acl_test.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'tests/defaults/acl_test.go') diff --git a/tests/defaults/acl_test.go b/tests/defaults/acl_test.go index 0dae018..bddb5e5 100644 --- a/tests/defaults/acl_test.go +++ b/tests/defaults/acl_test.go @@ -7,7 +7,6 @@ import ( "path/filepath" "syscall" "testing" - "time" "golang.org/x/sys/unix" @@ -21,8 +20,6 @@ func TestCpA(t *testing.T) { fn1 := filepath.Join(test_helpers.TmpDir, t.Name()) fn2 := filepath.Join(test_helpers.DefaultPlainDir, t.Name()) - rand.Seed(int64(time.Now().Nanosecond())) - { // Need unrestricted umask old := syscall.Umask(000) -- cgit v1.2.3