From 528a9b7c66f486b5cc1b2d8cbc5d90ae4532c1a8 Mon Sep 17 00:00:00 2001 From: Jon Walton Date: Wed, 18 Apr 2018 10:21:23 +0800 Subject: [PATCH] fix package paths on windows --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 95fe3866268..fe59ac0d0c7 100644 --- a/main.go +++ b/main.go @@ -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 {