-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Enhancement Task
- Many packages use the following init functions, which cannot achieve the effect of setting seeds. The
Rand
object fromNew
is unused.
func init() {
rand.New(rand.NewSource(time.Now().UnixNano()))
}
- The global
rand
function is thread-safe at the cost of having a global write lock. This may cause unexpected performance problems in some places.
Metadata
Metadata
Assignees
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.