diff options
| author | Jeff Carr <[email protected]> | 2025-01-30 14:11:45 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-30 14:11:45 -0600 |
| commit | 8130ffd25b3a4b43eb1d0e43afeb6dd27064fa6a (patch) | |
| tree | efc38181bfe5eb7e0c304314c72c7cb55b36ade9 /doStrict.go | |
| parent | 9c7572ca4517bfe28a305fd9fe828326a3e6b216 (diff) | |
Diffstat (limited to 'doStrict.go')
| -rw-r--r-- | doStrict.go | 19 |
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 } |
