aboutsummaryrefslogtreecommitdiffstats
path: root/device/allowedips_rand_test.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2020-12-22 11:38:24 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-07 14:49:44 +0100
commit1481e72107db7b42db88047ad1faf7cb6924fb78 (patch)
treecee7d0df35c37e9b03bae2d5330d0a2949f209af /device/allowedips_rand_test.go
parentdevice: remove unnecessary zeroing (diff)
downloadwireguard-go-1481e72107db7b42db88047ad1faf7cb6924fb78.tar.xz
wireguard-go-1481e72107db7b42db88047ad1faf7cb6924fb78.zip
all: use ++ to increment
Make the code slightly more idiomatic. No functional changes. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
Diffstat (limited to '')
-rw-r--r--device/allowedips_rand_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/device/allowedips_rand_test.go b/device/allowedips_rand_test.go
index 3947830..17e25b8 100644
--- a/device/allowedips_rand_test.go
+++ b/device/allowedips_rand_test.go
@@ -73,11 +73,11 @@ func TestTrieRandomIPv4(t *testing.T) {
const AddressLength = 4
- for n := 0; n < NumberOfPeers; n += 1 {
+ for n := 0; n < NumberOfPeers; n++ {
peers = append(peers, &Peer{})
}
- for n := 0; n < NumberOfAddresses; n += 1 {
+ for n := 0; n < NumberOfAddresses; n++ {
var addr [AddressLength]byte
rand.Read(addr[:])
cidr := uint(rand.Uint32() % (AddressLength * 8))
@@ -86,7 +86,7 @@ func TestTrieRandomIPv4(t *testing.T) {
slow = slow.Insert(addr[:], cidr, peers[index])
}
- for n := 0; n < NumberOfTests; n += 1 {
+ for n := 0; n < NumberOfTests; n++ {
var addr [AddressLength]byte
rand.Read(addr[:])
peer1 := slow.Lookup(addr[:])
@@ -106,11 +106,11 @@ func TestTrieRandomIPv6(t *testing.T) {
const AddressLength = 16
- for n := 0; n < NumberOfPeers; n += 1 {
+ for n := 0; n < NumberOfPeers; n++ {
peers = append(peers, &Peer{})
}
- for n := 0; n < NumberOfAddresses; n += 1 {
+ for n := 0; n < NumberOfAddresses; n++ {
var addr [AddressLength]byte
rand.Read(addr[:])
cidr := uint(rand.Uint32() % (AddressLength * 8))
@@ -119,7 +119,7 @@ func TestTrieRandomIPv6(t *testing.T) {
slow = slow.Insert(addr[:], cidr, peers[index])
}
- for n := 0; n < NumberOfTests; n += 1 {
+ for n := 0; n < NumberOfTests; n++ {
var addr [AddressLength]byte
rand.Read(addr[:])
peer1 := slow.Lookup(addr[:])