Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit ec50ada

Browse files
authored
Merge pull request #778 from ibrasho-forks/remove-slashing-in-SetPaths-DetectProjectGOPATH
dep: remove usage of filepath.FromSlash & filepath.ToSlash in context.go
2 parents c79b048 + 6e2930f commit ec50ada

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

context.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ func (c *Ctx) SetPaths(wd string, GOPATHs ...string) error {
6464
if len(GOPATHs) == 0 {
6565
GOPATHs = getGOPATHs(os.Environ())
6666
}
67-
for _, gp := range GOPATHs {
68-
c.GOPATHs = append(c.GOPATHs, filepath.ToSlash(gp))
69-
}
67+
68+
c.GOPATHs = append(c.GOPATHs, GOPATHs...)
7069

7170
return nil
7271
}
@@ -230,7 +229,7 @@ func (c *Ctx) DetectProjectGOPATH(p *Project) (string, error) {
230229
// detectGOPATH detects the GOPATH for a given path from ctx.GOPATHs.
231230
func (c *Ctx) detectGOPATH(path string) (string, error) {
232231
for _, gp := range c.GOPATHs {
233-
if fs.HasFilepathPrefix(filepath.FromSlash(path), gp) {
232+
if fs.HasFilepathPrefix(path, gp) {
234233
return gp, nil
235234
}
236235
}

0 commit comments

Comments
 (0)