From 8026729c43a07606f2a5cd0e6fbe4eb7bb72c9b4 Mon Sep 17 00:00:00 2001 From: Christian Ang Date: Thu, 24 Jun 2021 23:19:11 +0000 Subject: [PATCH] Use net.JoinHostPort instead of Sprintf Co-authored-by: Guangyuan Wang --- pkg/oidcclient/login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/oidcclient/login.go b/pkg/oidcclient/login.go index 40739eb8..fdf34eff 100644 --- a/pkg/oidcclient/login.go +++ b/pkg/oidcclient/login.go @@ -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 } }