[GH-ISSUE #160] Audit: Remove deprecated rand.Seed usage (Go 1.20+) #42

Closed
opened 2026-02-26 21:32:57 +03:00 by kerem · 1 comment
Owner

Originally created by @rudrankriyam on GitHub (Jan 25, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/160

Description

The codebase uses rand.Seed(time.Now().UnixNano()) in internal/asc/client_core.go:21, which is deprecated since Go 1.20. The random package is now auto-seeded.

Impact

  • Static analysis warning
  • Deprecated API usage
  • No functional impact but should be cleaned up

Location

internal/asc/client_core.go:21:

func init() {
    rand.Seed(time.Now().UnixNano())  // DEPRECATED
}

Fix

Remove the init() function entirely since Go 1.20+ auto-seeds the random package.

Severity

Critical

Originally created by @rudrankriyam on GitHub (Jan 25, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/160 ## Description The codebase uses `rand.Seed(time.Now().UnixNano())` in `internal/asc/client_core.go:21`, which is deprecated since Go 1.20. The random package is now auto-seeded. ## Impact - Static analysis warning - Deprecated API usage - No functional impact but should be cleaned up ## Location `internal/asc/client_core.go:21`: ```go func init() { rand.Seed(time.Now().UnixNano()) // DEPRECATED } ``` ## Fix Remove the `init()` function entirely since Go 1.20+ auto-seeds the random package. ## Severity Critical
kerem closed this issue 2026-02-26 21:32:57 +03:00
Author
Owner

@rudrankriyam commented on GitHub (Jan 25, 2026):

Closed via #170.

<!-- gh-comment-id:3797232643 --> @rudrankriyam commented on GitHub (Jan 25, 2026): Closed via #170.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#42
No description provided.