diff options
-rw-r--r-- | pkg/server/fsm.go | 2 | ||||
-rw-r--r-- | pkg/server/server_test.go | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/pkg/server/fsm.go b/pkg/server/fsm.go index 178c9cd5..5c85c876 100644 --- a/pkg/server/fsm.go +++ b/pkg/server/fsm.go @@ -557,7 +557,7 @@ func (h *fsmHandler) connectLoop(ctx context.Context, wg *sync.WaitGroup) { }, } - conn, err := d.DialContext(ctx, "tcp", net.JoinHostPort(addr, fmt.Sprintf("%d", port))) + conn, err := d.DialContext(ctx, "tcp", net.JoinHostPort(addr, strconv.Itoa(port))) select { case <-ctx.Done(): log.WithFields(log.Fields{ diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index f325f3ad..20d90edb 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -20,6 +20,7 @@ import ( "fmt" "net" "runtime" + "strconv" "testing" "time" @@ -161,7 +162,7 @@ func TestListPolicyAssignment(t *testing.T) { defer s.StopBgp(context.Background(), &api.StopBgpRequest{}) for i := 1; i < 4; i++ { - addr := fmt.Sprintf("127.0.0.%d", i) + addr := "127.0.0." + strconv.Itoa(i) p := &api.Peer{ Conf: &api.PeerConf{ NeighborAddress: addr, |