Skip to content

Commit

Permalink
Merge pull request 99designs#87 from jon-walton/windows-paths
Browse files Browse the repository at this point in the history
fix package paths on windows
  • Loading branch information
vektah authored Apr 18, 2018
2 parents 07350b1 + 528a9b7 commit 539e9af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ func fullPackageName(file string, override string) string {
pkgName = filepath.Join(filepath.Dir(pkgName), override)
}

for _, gopath := range strings.Split(build.Default.GOPATH, ":") {
gopath += "/src/"
for _, gopath := range filepath.SplitList(build.Default.GOPATH) {
gopath = filepath.Join(gopath, "src") + string(os.PathSeparator)
if strings.HasPrefix(pkgName, gopath) {
pkgName = pkgName[len(gopath):]
}
}
return pkgName
return filepath.ToSlash(pkgName)
}

func dirName(path string) string {
Expand Down

0 comments on commit 539e9af

Please sign in to comment.