From fb1e303870f60fe27298e0fa5f6615ab1dbbcafd Mon Sep 17 00:00:00 2001 From: JieJhih Jhang Date: Mon, 25 Mar 2019 23:59:56 +0800 Subject: fix same issues in other files --- pkg/server/fsm.go | 2 +- pkg/server/server_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'pkg') 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, -- cgit v1.2.3