fix: provider

This commit is contained in:
Rogee
2024-12-19 17:57:23 +08:00
parent 4702873975
commit e007535972
4 changed files with 88 additions and 18 deletions

View File

@@ -370,8 +370,15 @@ func renderFile(filename string, conf []Provider) error {
for k, v := range item.Imports {
// 如果是当前包的引用,直接使用包名
if strings.HasSuffix(k, "/"+v) {
v = ""
imports[k] = ""
continue
}
if gomod.GetPackageModuleName(k) == v {
imports[k] = ""
continue
}
imports[k] = v
}
})