Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: replace path with filepath #8488

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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