From f92ec4fc235a32b724ce70543f1051c7abb4e449 Mon Sep 17 00:00:00 2001 From: Andreas Eriksson Date: Wed, 11 Oct 2023 10:17:37 +0200 Subject: [PATCH] Fix rand.Seed deprecation --- servers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/servers.go b/servers.go index defba17..7c3dfca 100644 --- a/servers.go +++ b/servers.go @@ -337,12 +337,12 @@ func generateHostname() string { "water", "resonance", "sun", "wood", "dream", "cherry", "tree", "fog", "frost", "voice", "paper", "frog", "smoke", "star"} - rand.Seed(time.Now().UTC().UnixNano()) + r := rand.New(rand.NewSource(time.Now().UTC().UnixNano())) sections := []string{ - adjectives[rand.Intn(len(adjectives))], - nouns[rand.Intn(len(nouns))], - strconv.Itoa(100 + rand.Intn(899)), + adjectives[r.Intn(len(adjectives))], + nouns[r.Intn(len(nouns))], + strconv.Itoa(100 + r.Intn(899)), } return strings.Join(sections, "-")