We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39c1dd1 commit 00a5387Copy full SHA for 00a5387
rlp/rlpgen/gen.go
@@ -139,16 +139,16 @@ func (ctx *genContext) addImport(pkg *types.Package) string {
139
if p, exists := ctx.imports[pkg.Path()]; exists {
140
return p.alias
141
}
142
- baseName := pkg.Name()
143
- alias := baseName
144
- counter := 1
145
-
146
- // If the base name conflicts with any existing import, add a numeric suffix
+ var (
+ baseName = pkg.Name()
+ alias = baseName
+ counter = 1
+ )
147
+ // If the base name conflicts with an existing import, add a numeric suffix.
148
for ctx.hasAlias(alias) {
149
alias = fmt.Sprintf("%s%d", baseName, counter)
150
counter++
151
152
ctx.imports[pkg.Path()] = genImportPackage{alias, pkg}
153
return alias
154
0 commit comments