mirror of
https://github.com/slackhq/nebula.git
synced 2026-10-08 07:57:54 +02:00
for all of ./...
This commit is contained in:
@@ -27,7 +27,7 @@ func TestPacketsAreBalancedEqually(t *testing.T) {
|
||||
gw3count := 0
|
||||
|
||||
iterationCount := uint16(65535)
|
||||
for i := uint16(0); i < iterationCount; i++ {
|
||||
for i := range iterationCount {
|
||||
packet := firewall.Packet{
|
||||
LocalAddr: netip.MustParseAddr("192.168.1.1"),
|
||||
RemoteAddr: netip.MustParseAddr("10.0.0.1"),
|
||||
@@ -74,7 +74,7 @@ func TestPacketsAreBalancedByPriority(t *testing.T) {
|
||||
gw2count := 0
|
||||
|
||||
iterationCount := uint16(65535)
|
||||
for i := uint16(0); i < iterationCount; i++ {
|
||||
for i := range iterationCount {
|
||||
packet := firewall.Packet{
|
||||
LocalAddr: netip.MustParseAddr("192.168.1.1"),
|
||||
RemoteAddr: netip.MustParseAddr("10.0.0.1"),
|
||||
@@ -115,7 +115,7 @@ func TestBalancePacketDistributsRandomlyAndReturnsFalseIfBucketsNotCalculated(t
|
||||
gw1count := 0
|
||||
gw2count := 0
|
||||
|
||||
for i := uint16(0); i < iterationCount; i++ {
|
||||
for i := range iterationCount {
|
||||
packet := firewall.Packet{
|
||||
LocalAddr: netip.MustParseAddr("192.168.1.1"),
|
||||
RemoteAddr: netip.MustParseAddr("10.0.0.1"),
|
||||
|
||||
+5
-4
@@ -3,6 +3,7 @@ package routing
|
||||
import (
|
||||
"fmt"
|
||||
"net/netip"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -13,14 +14,14 @@ const (
|
||||
type Gateways []Gateway
|
||||
|
||||
func (g Gateways) String() string {
|
||||
str := ""
|
||||
var str strings.Builder
|
||||
for i, gw := range g {
|
||||
str += gw.String()
|
||||
str.WriteString(gw.String())
|
||||
if i < len(g)-1 {
|
||||
str += ", "
|
||||
str.WriteString(", ")
|
||||
}
|
||||
}
|
||||
return str
|
||||
return str.String()
|
||||
}
|
||||
|
||||
type Gateway struct {
|
||||
|
||||
Reference in New Issue
Block a user