Skip to content

Commit

Permalink
fix package paths on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-walton committed Apr 18, 2018
1 parent 66a9150 commit 53a6e81
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 53a6e81

Please sign in to comment.