chore: modernize some code

This commit is contained in:
Vincent Bernat
2025-11-14 23:11:53 +01:00
parent 625387a617
commit abca5e983d
21 changed files with 42 additions and 63 deletions

View File

@@ -8,6 +8,7 @@ import (
"math"
"math/rand/v2"
"net/netip"
"slices"
"testing"
"time"
@@ -102,14 +103,7 @@ func TestChooseRandom(t *testing.T) {
}
break
}
found := false
for _, v := range tc {
if v == result {
found = true
break
}
}
if !found {
if !slices.Contains(tc, result) {
t.Fatalf("chooseRandom() returned %d, not in slice",
result)
}