feat(goctl): go work multi-module support (#1800)
* feat(goctl): go work multi-module support Resolve: #1793 * chore: print log when getting project ctx fails
This commit is contained in:
@@ -2,6 +2,7 @@ package ctx
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/zeromicro/go-zero/tools/goctl/rpc/execx"
|
||||
@@ -31,6 +32,7 @@ func Prepare(workDir string) (*ProjectContext, error) {
|
||||
if err == nil {
|
||||
return ctx, nil
|
||||
}
|
||||
fmt.Printf("get project context from workdir[%s] failed: %s\n", workDir, err)
|
||||
|
||||
name := filepath.Base(workDir)
|
||||
_, err = execx.Run("go mod init "+name, workDir)
|
||||
|
||||
Reference in New Issue
Block a user