Use net.JoinHostPort instead of Sprintf
Co-authored-by: Guangyuan Wang <wguangyuan@vmware.com>
This commit is contained in:
parent
d19d63ad7d
commit
8026729c43
@ -140,7 +140,7 @@ func WithLogger(logger logr.Logger) Option {
|
||||
// system at the time of the request.
|
||||
func WithListenPort(port uint16) Option {
|
||||
return func(h *handlerState) error {
|
||||
h.listenAddr = fmt.Sprintf("localhost:%d", port)
|
||||
h.listenAddr = net.JoinHostPort("localhost", fmt.Sprint(port))
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user