Skip to content

Commit f187838

Browse files
welkeyeverAsterDY
authored andcommitted
chore: remove redundant code (cloudwego#8)
1 parent bb0a87f commit f187838

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/compress/golang/plugin/go_ast.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,7 @@ func (p *goParser) parseFile(filePath string) (map[string]*Function, error) {
102102
sysImports := make(map[string]string)
103103
for _, imp := range f.Imports {
104104
importPath := imp.Path.Value[1 : len(imp.Path.Value)-1] // remove the quotes
105-
var importAlias string
106-
if imp.Name != nil {
107-
importAlias = imp.Name.Name
108-
} else {
109-
importAlias = filepath.Base(importPath) // use the base name as alias by default
110-
}
111-
105+
importAlias := filepath.Base(importPath) // use the base name as alias by default
112106
// Check if user has defined an alias for current import
113107
if imp.Name != nil {
114108
importAlias = imp.Name.Name // update the alias

0 commit comments

Comments
 (0)