1
0
镜像自地址 https://github.com/beego/bee.git 已同步 2025-07-17 18:22:17 +00:00

Using local package name for renamed packages.

这个提交包含在:
Lei Cao
2015-05-14 15:56:19 +08:00
父节点 e23253bc23
当前提交 a1fe5bf010

查看文件

@@ -149,7 +149,11 @@ func generateDocs(curpath string) {
}
}
for _, im := range f.Imports {
analisyscontrollerPkg(im.Path.Value)
localName := ""
if im.Name != nil {
localName = im.Name.Name
}
analisyscontrollerPkg(localName, im.Path.Value)
}
for _, d := range f.Decls {
switch specDecl := d.(type) {
@@ -256,13 +260,17 @@ func analisysNSInclude(baseurl string, ce *ast.CallExpr) string {
return cname
}
func analisyscontrollerPkg(pkgpath string) {
func analisyscontrollerPkg(localName, pkgpath string) {
pkgpath = strings.Trim(pkgpath, "\"")
if isSystemPackage(pkgpath) {
return
}
pps := strings.Split(pkgpath, "/")
importlist[pps[len(pps)-1]] = pkgpath
if localName != "" {
importlist[localName] = pkgpath
} else {
pps := strings.Split(pkgpath, "/")
importlist[pps[len(pps)-1]] = pkgpath
}
if pkgpath == "github.com/astaxie/beego" {
return
}