From 0c79738656ecef727104a29316a4a3a5bb93a1d8 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 21 Aug 2024 14:59:51 -0400 Subject: [PATCH] root: silence staticcheck note about deprecated rand.Seed The latest lint CI run failed with 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. [...] So once our minimum Go version is 1.20.0, we can remove the rand.Seed() call. --- cmd/root.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 982346f7..2127cfbb 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -72,7 +72,8 @@ func NewRootCmd() *cobra.Command { } // Set random for application - rand.Seed(time.Now().UnixNano()) + // TODO: Remove Seed call once minimum Go is 1.20 (SA1019). + rand.Seed(time.Now().UnixNano()) //nolint:staticcheck cobra.OnInitialize(initConfig)