diff --git a/cmd/new.go b/cmd/new.go index 8de0105..be0f702 100644 --- a/cmd/new.go +++ b/cmd/new.go @@ -86,7 +86,18 @@ func createBasic(projectPath, modName string) error { return err } - return runCmd(execCommand("go", "mod", "init", modName)) + if err = runCmd(execCommand("go", "mod", "init", modName)); err != nil{ + return + } + + //Execute go mod tidy in the project directory + installModules := execCommand("go", "mod", "tidy") + installModules.Dir = fmt.Sprintf("%s%c", projectPath, os.PathSeparator) + if err = runCmd(installModules); err != nil{ + return + } + + return } const (