Skip to content

Commit

Permalink
Merge pull request #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 546b7b7 + 53a6e81 commit 091d25a
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 091d25a

Please sign in to comment.