diff --git a/g_appcode.go b/g_appcode.go index e20cc63..e494130 100644 --- a/g_appcode.go +++ b/g_appcode.go @@ -962,13 +962,21 @@ func getPackagePath(curpath string) (packpath string) { wgopath := filepath.SplitList(gopath) for _, wg := range wgopath { - wg, _ = filepath.EvalSymlinks(path.Join(wg, "src")) - + //Maybe is a path if filepath.HasPrefix(strings.ToLower(curpath), strings.ToLower(wg)) { haspath = true appsrcpath = wg break } + + //Maybe is a symlink + wg, _ = filepath.EvalSymlinks(path.Join(wg, "src")) + cur,_ := filepath.EvalSymlinks(curpath) + if filepath.HasPrefix(strings.ToLower(cur), strings.ToLower(wg)) { + haspath = true + appsrcpath = wg + break + } } if !haspath {