File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -385,7 +385,7 @@ type symtab struct {
385
385
syms map [string ]* symbol
386
386
imports map [string ]string // key is full path, value is unique name
387
387
importNames map [string ]string // package name to path map -- for detecting name conflicts
388
- uniqName byte // char for making package name unique
388
+ uniqName int // index for making package name unique
389
389
parent * symtab
390
390
}
391
391
@@ -435,13 +435,11 @@ func (sym *symtab) addImport(pkg *types.Package) string {
435
435
}
436
436
ep , exists = sym .importNames [nm ]
437
437
if exists && ep != p {
438
- if sym .uniqName == 0 {
439
- sym .uniqName = 'a'
440
- } else {
438
+ if exists && ep != p {
441
439
sym .uniqName ++
440
+ unm = fmt .Sprintf ("s%d_%s" , sym .uniqName , nm )
441
+ fmt .Printf ("import conflict: existing: %s new: %s alias: %s\n " , ep , p , unm )
442
442
}
443
- unm = string ([]byte {sym .uniqName }) + nm
444
- fmt .Printf ("import conflict: existing: %s new: %s alias: %s\n " , ep , p , unm )
445
443
}
446
444
sym .importNames [unm ] = p
447
445
sym .imports [p ] = unm
You can’t perform that action at this time.
0 commit comments