Skip to content

Commit

Permalink
root: silence staticcheck note about deprecated rand.Seed
Browse files Browse the repository at this point in the history
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.2.0, we can remove this.
  • Loading branch information
kyleam committed Aug 21, 2024
1 parent 68fc321 commit 95593d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 95593d1

Please sign in to comment.