summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorJieJhih Jhang <aawer12345tw@yahoo.com.tw>2019-03-25 22:55:35 +0800
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-03-26 07:44:02 +0900
commit275966f6cff4525532042e2cc342ea25f8dd033a (patch)
tree6099c82b5b087991b98875af626089f5dbad7bf7 /cmd
parent4a7c30cb8faae7153d197977493bfd3c6f0820b9 (diff)
Use Itoa method instead sprintf
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gobgp/root.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/gobgp/root.go b/cmd/gobgp/root.go
index dc8a3fe1..539ae2ed 100644
--- a/cmd/gobgp/root.go
+++ b/cmd/gobgp/root.go
@@ -17,9 +17,9 @@ package main
import (
"context"
- "fmt"
"net/http"
_ "net/http/pprof"
+ "strconv"
api "github.com/osrg/gobgp/api"
"github.com/spf13/cobra"
@@ -49,7 +49,8 @@ func newRootCmd() *cobra.Command {
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if globalOpts.PprofPort > 0 {
go func() {
- if err := http.ListenAndServe(fmt.Sprintf("localhost:%d", globalOpts.PprofPort), nil); err != nil {
+ address := "localhost:" + strconv.Itoa(globalOpts.PprofPort)
+ if err := http.ListenAndServe(address, nil); err != nil {
exitWithError(err)
}
}()