From da2c14d45f8f2e71c7182bbf84d58bd270d06ef0 Mon Sep 17 00:00:00 2001 From: kesonan Date: Mon, 5 Aug 2024 23:29:06 +0800 Subject: [PATCH] (goctl): fix quickstart error while reading go module info (#4297) --- tools/goctl/quickstart/quickstart.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/goctl/quickstart/quickstart.go b/tools/goctl/quickstart/quickstart.go index de4d2dcc..59d1fd9f 100644 --- a/tools/goctl/quickstart/quickstart.go +++ b/tools/goctl/quickstart/quickstart.go @@ -56,12 +56,8 @@ func initProject() { } log.Must(pathx.MkdirIfNotExist(projectDir)) - if hasGoMod, _ := ctx.IsGoMod(projectDir); hasGoMod { - return - } - if exitCode := execCommand(projectDir, "go mod init "+baseDir); exitCode != 0 { - log.Fatalln("Init process exit") - } + _, err = ctx.Prepare(projectDir) + logx.Must(err) } func run(_ *cobra.Command, _ []string) error {