mirror of
https://github.com/containers/podman.git
synced 2025-05-17 06:59:07 +08:00
18 lines
411 B
Go
18 lines
411 B
Go
// In go 1.20 and later, the global RNG is automatically initialized.
|
|
// Ref: https://pkg.go.dev/math/rand@go1.20#Seed
|
|
//go:build !go1.20 && !remote
|
|
|
|
package libpod
|
|
|
|
import (
|
|
"math/rand"
|
|
"time"
|
|
)
|
|
|
|
func init() {
|
|
// generateName calls namesgenerator.GetRandomName which the
|
|
// global RNG from math/rand. Seed it here to make sure we
|
|
// don't get the same name every time.
|
|
rand.Seed(time.Now().UnixNano())
|
|
}
|