Skip to content

Commit 16e01c2

Browse files
committed
fix(gen): fix gen when has go.work files
1 parent ef772ec commit 16e01c2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

cmd/jzero/internal/command/gen/genapi/patch_handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ func UpdateImportedModule(filepath string, f *ast.File, fset *token.FileSet, wor
288288
unQuote, _ := strconv.Unquote(name.Path.Value)
289289
newImp := strings.Replace(unQuote, rootPkg, module, 1)
290290
astutil.RewriteImport(fset, f, unQuote, newImp)
291+
astutil.DeleteImport(fset, f, unQuote)
291292
logx.Debugf("UpdateImportedModule: rewrite import %s to %s", unQuote, newImp)
292293
}
293294
}

0 commit comments

Comments
 (0)