From e98027e5d76b3a9bee12e83a7a4c8a998ba1920c Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Mon, 5 Aug 2024 15:15:10 +0800 Subject: [PATCH] replace path Signed-off-by: Ryan Leung --- pkg/dashboard/distroutil/distro.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/dashboard/distroutil/distro.go b/pkg/dashboard/distroutil/distro.go index 9eb1a2eb31b..a19db806d70 100644 --- a/pkg/dashboard/distroutil/distro.go +++ b/pkg/dashboard/distroutil/distro.go @@ -16,7 +16,7 @@ package distroutil import ( "os" - "path" + "path/filepath" "github.com/pingcap/log" "github.com/pingcap/tidb-dashboard/util/distro" @@ -36,7 +36,7 @@ func MustGetResPath() string { log.Fatal("failed to read the execution path", zap.Error(err)) return "" } - return path.Join(path.Dir(exePath), resFolderName) + return filepath.Join(filepath.Dir(exePath), resFolderName) } // MustLoadAndReplaceStrings loads the distro strings from ${BinaryPath}/distro-res/strings.json @@ -44,7 +44,7 @@ func MustGetResPath() string { // distro string will be used. func MustLoadAndReplaceStrings() { resPath := MustGetResPath() - strings, err := distro.ReadResourceStringsFromFile(path.Join(resPath, stringsFileName)) + strings, err := distro.ReadResourceStringsFromFile(filepath.Join(resPath, stringsFileName)) if err != nil { log.Fatal("failed to load distro strings", zap.Error(err)) }