Skip to content

Commit

Permalink
add: 计算引入别名
Browse files Browse the repository at this point in the history
  • Loading branch information
cyz-home committed May 29, 2023
1 parent db6d0c3 commit 160d7f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions parser/help_str.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func GetImportStrForMap(m map[string]string) string {
func GenImportAlias(path, packageName string, m map[string]string) map[string]string {
aliasMapImport := make(map[string]string)
importMapAlias := make(map[string]string)
importCheck := make(map[string][]string)
importCheck := make(map[string]map[string]bool)

keys := make([]string, 0)
for s, _ := range m {
Expand All @@ -474,12 +474,12 @@ func GenImportAlias(path, packageName string, m map[string]string) map[string]st
if key == packageName {
kk := len(importCheck[key])
if kk == 0 {
importCheck[key] = []string{}
importCheck[key] = map[string]bool{}
}
if "/bootstrap/providers" != path {
kkk := key + "_" + strconv.Itoa(kk)
kkk := key + "_" + strconv.Itoa(kk)
if "/bootstrap/providers" != path && !importCheck[key][kkk] {
aliasMapImport[kkk] = imp
importCheck[key] = append(importCheck[key], kkk)
importCheck[key][kkk] = true
}
} else {
aliasMapImport[key] = imp
Expand Down

0 comments on commit 160d7f0

Please sign in to comment.