mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
node: optimize port formatting using strconv.Itoa
This commit is contained in:
parent
41f580f209
commit
c9f1ccb9aa
1 changed files with 3 additions and 2 deletions
|
|
@ -23,6 +23,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
|
@ -264,7 +265,7 @@ func (c *Config) HTTPEndpoint() string {
|
||||||
if c.HTTPHost == "" {
|
if c.HTTPHost == "" {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return net.JoinHostPort(c.HTTPHost, fmt.Sprintf("%d", c.HTTPPort))
|
return net.JoinHostPort(c.HTTPHost, strconv.Itoa(c.HTTPPort))
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultHTTPEndpoint returns the HTTP endpoint used by default.
|
// DefaultHTTPEndpoint returns the HTTP endpoint used by default.
|
||||||
|
|
@ -279,7 +280,7 @@ func (c *Config) WSEndpoint() string {
|
||||||
if c.WSHost == "" {
|
if c.WSHost == "" {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return net.JoinHostPort(c.WSHost, fmt.Sprintf("%d", c.WSPort))
|
return net.JoinHostPort(c.WSHost, strconv.Itoa(c.WSPort))
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultWSEndpoint returns the websocket endpoint used by default.
|
// DefaultWSEndpoint returns the websocket endpoint used by default.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue