diff --git a/cmd/new.go b/cmd/new.go index 8de0105..5d87372 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 err + } + + //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 err + } + + return nil } const (