aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2022-03-29 07:46:37 -0500
committerAnthony Wang2022-03-29 07:46:37 -0500
commita6f1a57e0aacd46a0d6184dad6eaf9ee4ed4f342 (patch)
treec46893110bf3d42a0c77b5201ac9b2cd4619d608
parent0f9882eaaa4cbefa200a8204f1d3c9566912b9fc (diff)
Seed RNG if not debugging
-rw-r--r--sd.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/sd.go b/sd.go
index 767bc81..4470b28 100644
--- a/sd.go
+++ b/sd.go
@@ -7,6 +7,7 @@ import (
"math/rand"
"os"
"os/exec"
+ "time"
_ "modernc.org/sqlite"
)
@@ -17,6 +18,11 @@ var (
)
func main() {
+ if !*verbose {
+ // Seed the RNG
+ rand.Seed(time.Now().UnixNano())
+ }
+
flag.Parse()
db, err := sql.Open("sqlite", *file)