summaryrefslogtreecommitdiff
path: root/doStrict.go
diff options
context:
space:
mode:
Diffstat (limited to 'doStrict.go')
-rw-r--r--doStrict.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/doStrict.go b/doStrict.go
index ca9186b..34cffb5 100644
--- a/doStrict.go
+++ b/doStrict.go
@@ -2,6 +2,7 @@ package main
import (
"errors"
+ "os"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
@@ -59,8 +60,15 @@ func doStrict(repo *gitpb.Repo) error {
log.Info(repo.GetGoPath(), "GOING TO MAKE NEW go.* FILES")
// actually will re-create go.sum and go.mod now
- if _, err = repo.RunQuiet([]string{"go", "mod", "init", repo.GetGoPath()}); err != nil {
+ os.Unsetenv("GO111MODULE")
+ if result, err := repo.RunQuiet([]string{"go", "mod", "init", repo.GetGoPath()}); err != nil {
log.Warn("go mod init failed", err)
+ for _, line := range result.Stdout {
+ log.Warn("stdout:", line)
+ }
+ for _, line := range result.Stderr {
+ log.Warn("stderr:", line)
+ }
return err
}
@@ -69,9 +77,16 @@ func doStrict(repo *gitpb.Repo) error {
return err
}
- if _, err := repo.RunQuiet([]string{"go", "mod", "tidy", "-go=" + golangVersion}); err != nil {
+ os.Unsetenv("GO111MODULE")
+ if result, err := repo.RunQuiet([]string{"go", "mod", "tidy", "-go=" + golangVersion}); err != nil {
// I guess the thing to do, if go mod tidy fails, is to just leave the repo alone
// it's either primitive or could be a go support project but not in go
+ for _, line := range result.Stdout {
+ log.Warn("stdout:", line)
+ }
+ for _, line := range result.Stderr {
+ log.Warn("stderr:", line)
+ }
return nil
}