diff options
author | Luka Markušić <luka.markusic@microblink.com> | 2022-07-31 08:43:31 +0200 |
---|---|---|
committer | Luka Markušić <luka.markusic@microblink.com> | 2022-07-31 08:43:31 +0200 |
commit | 767ef3166106d32bb60bf580f553dfa220d12391 (patch) | |
tree | 65de7a8aa5bfcb5d19453df88836d253113f7ed4 /pkg/gui | |
parent | 966733240c0a6b2ca2233aa260966d53915254e0 (diff) |
Use filepath.Join instead of manual concat
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/recent_repos_panel.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/gui/recent_repos_panel.go b/pkg/gui/recent_repos_panel.go index bfc363e76..fc2c38262 100644 --- a/pkg/gui/recent_repos_panel.go +++ b/pkg/gui/recent_repos_panel.go @@ -18,7 +18,7 @@ import ( func (gui *Gui) getCurrentBranch(path string) string { readHeadFile := func(path string) (string, error) { - headFile, err := ioutil.ReadFile(fmt.Sprintf("%s%cHEAD", path, os.PathSeparator)) + headFile, err := ioutil.ReadFile(filepath.Join(path, "HEAD")) if err == nil { content := strings.TrimSpace(string(headFile)) branch := strings.TrimPrefix(content, "ref: refs/heads/") @@ -27,7 +27,7 @@ func (gui *Gui) getCurrentBranch(path string) string { return "", err } - gitDirPath := fmt.Sprintf("%s%c.git", path, os.PathSeparator) + gitDirPath := filepath.Join(path, ".git") if gitDir, err := os.Stat(gitDirPath); err == nil { if gitDir.IsDir() { |