diff options
| author | Jeff Carr <[email protected]> | 2024-11-30 02:03:32 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-30 02:03:32 -0600 |
| commit | 3de739288be1394cc1679c4391058173984e5873 (patch) | |
| tree | 585f127eb88abcd6ab28c36e635dc3ae72150ccf | |
| parent | 5d28c6741ab043ae1deeca6bf4ff4c4d8ea4d455 (diff) | |
moving go.mod handling herev0.0.2
| -rw-r--r-- | goDep.redoGoMod.go | 8 | ||||
| -rw-r--r-- | shell.go | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/goDep.redoGoMod.go b/goDep.redoGoMod.go index 81e861f..ccf64ef 100644 --- a/goDep.redoGoMod.go +++ b/goDep.redoGoMod.go @@ -16,7 +16,7 @@ import ( // repos you can also type "make redomod" to do the same thing // since it's a Makefile task that is also useful to be able to run // from the command line -func (repo *Repo) MakeRedomod() (bool, error) { +func (repo *Repo) RedoGoMod() (bool, error) { // unset the go development ENV var to generate release files os.Unsetenv("GO111MODULE") if ok, err := repo.strictRun([]string{"rm", "-f", "go.mod", "go.sum"}); !ok { @@ -32,12 +32,11 @@ func (repo *Repo) MakeRedomod() (bool, error) { return ok, err } // most things should build with golang after 1.20 - // TODO: move this to autogenpb if ok, err := repo.strictRun([]string{"go", "mod", "edit", "-go=1.20"}); !ok { log.Warn("go mod edit failed", err) return ok, err } - log.Info("MakeRedomod() worked", repo.GoPath) + // log.Info("MakeRedomod() worked", repo.GoPath) if repo.Exists("go.sum") { // return the attempt to parse go.mod & go.sum @@ -89,6 +88,9 @@ func (repo *Repo) parseGoSum() (bool, error) { GoPath: godep, Version: version, } + if repo.GoDeps == nil { + repo.GoDeps = new(GoDeps) + } repo.GoDeps.AppendUniqueGoPath(&new1) /* found := repo.FindGoDepByPath(godep) @@ -36,7 +36,7 @@ func (repo *Repo) RunQuiet(cmd []string) cmd.Status { // for now, even check cmd.Exit func (repo *Repo) strictRun(cmd []string) (bool, error) { - result := repo.Run(cmd) + result := repo.RunQuiet(cmd) if result.Error != nil { log.Warn("go mod init failed err:", result.Error) return false, result.Error |
