Skip to content

Commit

Permalink
*: replace path with filepath (#8488)
Browse files Browse the repository at this point in the history
ref #8475

Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
rleungx and ti-chi-bot[bot] authored Aug 5, 2024
1 parent 73eb0d5 commit bf501d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/dashboard/distroutil/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package distroutil

import (
"os"
"path"
"path/filepath"

"github.com/pingcap/log"
"github.com/pingcap/tidb-dashboard/util/distro"
Expand All @@ -36,15 +36,15 @@ 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
// and replace the strings in the TiDB Dashboard. If the strings file does not exist, the default
// 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))
}
Expand Down

0 comments on commit bf501d8

Please sign in to comment.