From 275966f6cff4525532042e2cc342ea25f8dd033a Mon Sep 17 00:00:00 2001 From: JieJhih Jhang Date: Mon, 25 Mar 2019 22:55:35 +0800 Subject: Use Itoa method instead sprintf --- cmd/gobgp/root.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cmd') 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) } }() -- cgit v1.2.3