diff --git a/pkg/get.go b/pkg/get.go index a3e14c1..37e57aa 100644 --- a/pkg/get.go +++ b/pkg/get.go @@ -4,7 +4,7 @@ import ( "fmt" "git-get/pkg/git" "git-get/pkg/io" - "path" + "path/filepath" ) // GetCfg provides configuration for the Get command. @@ -40,7 +40,7 @@ func cloneSingleRepo(c *GetCfg) error { opts := &git.CloneOpts{ URL: url, - Path: path.Join(c.Root, URLToPath(url)), + Path: filepath.Join(c.Root, URLToPath(url)), Branch: c.Branch, } @@ -63,7 +63,7 @@ func cloneDumpFile(c *GetCfg) error { opts := &git.CloneOpts{ URL: url, - Path: path.Join(c.Root, URLToPath(url)), + Path: filepath.Join(c.Root, URLToPath(url)), Branch: line.branch, } diff --git a/pkg/git/config_test.go b/pkg/git/config_test.go index bc3e96a..6a5bc67 100644 --- a/pkg/git/config_test.go +++ b/pkg/git/config_test.go @@ -4,7 +4,7 @@ import ( "git-get/pkg/io" "git-get/pkg/run" "git-get/pkg/test" - "path" + "path/filepath" "testing" ) @@ -75,7 +75,7 @@ func TestGitConfig(t *testing.T) { func makeConfigEmpty(t *testing.T) *cfgStub { c := newCfgStub(t) - io.Write(path.Join(c.repo.Path(), dotgit, "config"), "") + io.Write(filepath.Join(c.repo.Path(), dotgit, "config"), "") return c } @@ -89,7 +89,7 @@ func makeConfigValid(t *testing.T) *cfgStub { [gitget] host = github.com ` - io.Write(path.Join(c.repo.Path(), dotgit, "config"), gitconfig) + io.Write(filepath.Join(c.repo.Path(), dotgit, "config"), gitconfig) return c } diff --git a/pkg/test/helpers.go b/pkg/test/helpers.go index 55b1471..b9c8593 100644 --- a/pkg/test/helpers.go +++ b/pkg/test/helpers.go @@ -4,12 +4,12 @@ import ( "fmt" "git-get/pkg/io" "git-get/pkg/run" - "path" + "path/filepath" "testing" ) func (r *Repo) writeFile(filename string, content string) { - path := path.Join(r.path, filename) + path := filepath.Join(r.path, filename) err := io.Write(path, content) checkFatal(r.t, err) } diff --git a/pkg/url.go b/pkg/url.go index 68a6bf5..9a29721 100644 --- a/pkg/url.go +++ b/pkg/url.go @@ -2,7 +2,7 @@ package pkg import ( urlpkg "net/url" - "path" + "path/filepath" "regexp" "strings" @@ -67,7 +67,7 @@ func URLToPath(url *urlpkg.URL) (repoPath string) { repoHost := strings.Split(url.Host, ":")[0] // Remove trailing ".git" from repo name - repoPath = path.Join(repoHost, url.Path) + repoPath = filepath.Join(repoHost, url.Path) repoPath = strings.TrimSuffix(repoPath, ".git") // Remove tilde (~) char from username