Merge pull request #117 from tike/master

fix import path trimming during main.go generation
This commit is contained in:
notzippy
2018-02-04 16:32:57 -08:00
committed by GitHub

View File

@@ -830,9 +830,8 @@ func IsBuiltinType(name string) bool {
} }
func importPathFromPath(root string) string { func importPathFromPath(root string) string {
vendoringPath := revel.BasePath + "/vendor/" if vendorIdx := strings.Index(root, "/vendor/"); vendorIdx != -1 {
if strings.HasPrefix(root, vendoringPath) { return filepath.ToSlash(root[vendorIdx+8:])
return filepath.ToSlash(root[len(vendoringPath):])
} }
for _, gopath := range filepath.SplitList(build.Default.GOPATH) { for _, gopath := range filepath.SplitList(build.Default.GOPATH) {
srcPath := filepath.Join(gopath, "src") srcPath := filepath.Join(gopath, "src")