summaryrefslogtreecommitdiff
path: root/redoGoMod.go
diff options
context:
space:
mode:
Diffstat (limited to 'redoGoMod.go')
-rw-r--r--redoGoMod.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/redoGoMod.go b/redoGoMod.go
index 1cf50dc..7bc38ae 100644
--- a/redoGoMod.go
+++ b/redoGoMod.go
@@ -45,11 +45,17 @@ func redoGoMod(repo *gitpb.Repo) error {
log.Warn("rm go.mod go.sum failed", err)
return err
}
+
if _, err := repo.RunQuiet([]string{"go", "mod", "init", repo.GetGoPath()}); err != nil {
log.Warn("go mod init failed", err)
return err
}
+ if _, err := repo.RunQuiet([]string{"go", "mod", "tidy"}); err != nil {
+ log.Warn("go mod init failed", err)
+ return err
+ }
+
// parse the go.mod and go.sum files
if repo.ParseGoSum() {
return nil