lame oversight on my part
This commit is contained in:
parent
9c7572ca45
commit
8130ffd25b
19
doStrict.go
19
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue