From 9e1bb52f2b9873f3da4f6c181ada7e98e95a4114 Mon Sep 17 00:00:00 2001 From: Gaius Date: Fri, 11 Aug 2023 14:03:01 +0800 Subject: [PATCH] feat: net.JoinHostPort replace fmt.Sprintf (#2622) Signed-off-by: Gaius --- client/config/dfstore.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/config/dfstore.go b/client/config/dfstore.go index aafb1b33c..6acfcc3f6 100644 --- a/client/config/dfstore.go +++ b/client/config/dfstore.go @@ -19,6 +19,7 @@ package config import ( "errors" "fmt" + "net" "net/url" ) @@ -44,7 +45,7 @@ type DfstoreConfig struct { func NewDfstore() *DfstoreConfig { url := url.URL{ Scheme: "http", - Host: fmt.Sprintf("%s:%d", "127.0.0.1", DefaultObjectStorageStartPort), + Host: net.JoinHostPort("127.0.0.1", fmt.Sprint(DefaultObjectStorageStartPort)), } return &DfstoreConfig{