mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Merge pull request #117 from tike/master
fix import path trimming during main.go generation
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user