refactor gomod logic (#47)

* rebase upstream

* rebase

* trim no need line

* trim no need line

* trim no need line

* refactor gomod module logic

Co-authored-by: kingxt <dream4kingxt@163.com>
This commit is contained in:
kingxt
2020-09-07 18:04:59 +08:00
committed by GitHub
parent c5cd0d32d1
commit 1602f6ce81
3 changed files with 26 additions and 43 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/tools/goctl/util"
"github.com/tal-tech/go-zero/tools/goctl/util/console"
"github.com/tal-tech/go-zero/tools/goctl/util/project"
"github.com/tal-tech/go-zero/tools/goctl/util/stringx"
"github.com/urfave/cli"
)
@@ -34,7 +35,7 @@ type RpcContext struct {
func MustCreateRpcContext(protoSrc, targetDir, serviceName string, idea bool) *RpcContext {
log := console.NewConsole(idea)
info, err := prepare(log)
info, err := project.Prepare(targetDir, true)
log.Must(err)
if stringx.From(protoSrc).IsEmptyOrSpace() {