1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

Update to math/rand/v2

This commit updates the uses of math/rand to math/rand/v2, which was
released in Go 1.22 (2024-02).

The new package is generally safer, see https://go.dev/blog/randv2 for
the details.

There are no user-visible changes, it is only adjusting the name of
functions, simplify some code thanks to v2 having a better API, etc.
This commit is contained in:
Alberto Bertogli
2025-02-16 20:18:16 +00:00
parent cef7bb079d
commit 45580dae46
7 changed files with 22 additions and 31 deletions

View File

@@ -8,7 +8,6 @@ import (
"context"
"flag"
"fmt"
"math/rand"
"net"
"os"
"os/signal"
@@ -52,9 +51,6 @@ func main() {
log.Infof("chasquid starting (version %s)", version)
// Seed the PRNG, just to prevent for it to be totally predictable.
rand.Seed(time.Now().UnixNano())
conf, err := config.Load(*configDir+"/chasquid.conf", *configOverrides)
if err != nil {
log.Fatalf("Error loading config: %v", err)