diff options
author | Josh Bleecher Snyder <josh@tailscale.com> | 2020-12-22 11:38:24 -0800 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-01-07 14:49:44 +0100 |
commit | 1481e72107db7b42db88047ad1faf7cb6924fb78 (patch) | |
tree | cee7d0df35c37e9b03bae2d5330d0a2949f209af /device/allowedips_rand_test.go | |
parent | d0f8e9477c14a1c92f84beb46cd17b91c56fae44 (diff) |
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 'device/allowedips_rand_test.go')
-rw-r--r-- | device/allowedips_rand_test.go | 12 |
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[:]) |