Skip to content

Commit

Permalink
fix gf gen ctrl import (#2771)
Browse files Browse the repository at this point in the history
  • Loading branch information
oldme-git committed Jul 19, 2023
1 parent d72997d commit b71ac86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/gf/internal/cmd/genctrl/genctrl_generate_ctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ func (c *controllerGenerator) doGenerateCtrlNewByModuleAndVersion(
newFuncNameDefinition = fmt.Sprintf(`func %s()`, newFuncName)
alreadyCreated bool
)
// replace "\" to "/", fix import error
importPath = gstr.Replace(importPath, "\\", "/", -1)
if !gfile.Exists(moduleFilePath) {
content := gstr.ReplaceByMap(consts.TemplateGenCtrlControllerEmpty, g.MapStrStr{
"{Module}": module,
Expand Down

0 comments on commit b71ac86

Please sign in to comment.