summaryrefslogtreecommitdiffhomepage
path: root/pkg/server
diff options
context:
space:
mode:
authorJieJhih Jhang <aawer12345tw@yahoo.com.tw>2019-03-25 23:59:56 +0800
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-03-26 07:44:02 +0900
commitfb1e303870f60fe27298e0fa5f6615ab1dbbcafd (patch)
treebd56a4cd456b1e60ee793073aad92b4d67fbc790 /pkg/server
parent275966f6cff4525532042e2cc342ea25f8dd033a (diff)
fix same issues in other files
Diffstat (limited to 'pkg/server')
-rw-r--r--pkg/server/fsm.go2
-rw-r--r--pkg/server/server_test.go3
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,