aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2023-10-25 22:52:30 +0200
committerRobin Jarry <robin@jarry.cc>2023-10-26 00:29:25 +0200
commitf4166e07439fc08b3a632664a74ec6943b2050c7 (patch)
treece2188b5483bc47ba29254a8fcf8c36d88da7941
parent2d9654df229b97237cd9a9157ac96d89c5ce2630 (diff)
downloadaerc-f4166e07439fc08b3a632664a74ec6943b2050c7.tar.gz
aerc-f4166e07439fc08b3a632664a74ec6943b2050c7.zip
aerc: initialise the random number generator
Add an init function to the main package that seeds the RNG with based on the current time. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index d63c9eef..95c9615b 100644
--- a/main.go
+++ b/main.go
@@ -5,6 +5,7 @@ import (
"encoding/base64"
"errors"
"fmt"
+ "math/rand"
"os"
"runtime"
"sort"
@@ -321,3 +322,7 @@ loop:
}
}
}
+
+func init() {
+ rand.Seed(time.Now().UnixNano())
+}