mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
Use Itoa method instead sprintf
This commit is contained in:
committed by
FUJITA Tomonori
parent
4a7c30cb8f
commit
275966f6cf
+3
-2
@@ -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)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user