summaryrefslogtreecommitdiff
path: root/redoGoMod.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-05-29 19:17:50 -0500
committerJeff Carr <[email protected]>2025-05-29 19:17:50 -0500
commita29e10e9116f4d5ab80210b3eb8e25b674d3338f (patch)
treeb6182f8668da2dd246092f6fe6c7dad0093d3121 /redoGoMod.go
parent2b85f5e17dda4bea2b9403668c66e291dfa67591 (diff)
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