moved lots of logic to go-mod-clean

This commit is contained in:
Jeff Carr 2025-02-07 11:21:51 -06:00
parent 3ceb5d0bf5
commit 021c7774b2
4 changed files with 16 additions and 42 deletions

View File

@ -69,48 +69,19 @@ func findNext() bool {
log.Info("findNext() alreadyDone. WHY IS THIS STILL CHECKING?", check.GetGoPath())
continue
}
log.Info("CHECKING:", check.GetGoPath())
// _, err := check.RunVerboseOnError([]string{"go-mod-clean", "--strict"})
_, err := check.RunQuiet([]string{"go-mod-clean", "--smart"})
if err != nil {
log.Info("FAILED: findNext() go-mod-clean --smart", check.GetGoPath(), err)
continue
}
findCounter += 1
if !check.ParseGoSum() {
log.Info("ParseGoSum() failed", check.GetGoPath())
log.Info("ParseGoSum() failed", check.GetGoPath())
log.Info("ParseGoSum() failed", check.GetGoPath())
continue
}
log.Info("CHECKING START:", check.GetGoPath())
/*
if err := me.forge.CleanGoDepsCheckOk(check); err != nil {
log.Info("CleanGoDepsCheckOk() failed", check.GetGoPath(), err)
log.Info("CleanGoDepsCheckOk() failed", check.GetGoPath(), err)
findCounter += 1
if !check.ParseGoSum() {
log.Info("ParseGoSum() failed", check.GetGoPath())
log.Info("ParseGoSum() failed", check.GetGoPath())
log.Info("ParseGoSum() failed", check.GetGoPath())
continue
}
*/
/*
if err := checkDeps(check); err != nil {
log.Info("CHECK DEPS FAILED", check.GetGoPath(), err)
log.Info("CHECK DEPS FAILED", check.GetGoPath(), err)
log.Info("CHECK DEPS FAILED", check.GetGoPath(), err)
continue
} else {
log.Info("Might be ok?", check.GetGoPath())
}
*/
fixGodeps(check)
/*
} else {
log.Info("SKIPPING FIX", check.GetGoPath())
log.Info("SKIPPING FIX", check.GetGoPath())
log.Info("SKIPPING FIX", check.GetGoPath())
}
*/
// fixGodeps(check)
if err := me.forge.FinalGoDepsCheckOk(check, argv.Verbose); err != nil {
// if err := me.forge.FinalGoDepsCheckOk(check, false); err != nil {
@ -138,7 +109,7 @@ func findNext() bool {
}
// tries to fix the go.mod and go.sum files
func fixGodeps(check *gitpb.Repo) bool {
func fixGodepsOLD(check *gitpb.Repo) bool {
var good bool = true
check.GoDeps = nil

View File

@ -94,7 +94,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
return
}
// destroy and recreate the go.sum
fixGodeps(check)
fixGodepsOLD(check)
findOk = true
return
case "/showNext":

View File

@ -51,10 +51,10 @@ func rillRestore(repo *gitpb.Repo) error {
return nil
}
_, err := repo.RunQuiet([]string{"go-mod-clean", "--restore"})
_, err := repo.RunQuiet([]string{"go-mod-clean", "--smart"})
rillcount += 1
if err != nil {
log.Info("go-mod-clean --restore failed", repo.GetGoPath(), err)
log.Info("go-mod-clean --smart failed", repo.GetGoPath(), err)
return err
}
return nil
@ -65,7 +65,7 @@ func rePrepareRelease() {
// me.forge = forgepb.Init()
me.found = new(gitpb.Repos)
log.Printf("rePrepareRelease() START rill go-mod-clean --restore (11 seconds?)")
log.Printf("rePrepareRelease() START rill go-mod-clean --smart (11 seconds?)")
rillcount = 0
now := time.Now()
me.forge.RillFuncError(rillRestore)

View File

@ -51,7 +51,10 @@ func createReleaseBox(box *gui.Node) {
buttonEnable()
log.Info("doRelease() worked")
} else {
log.Info("doRelease() failed", err, me.current.GetGoPath())
log.Info("doRelease() failed", err)
log.Info("doRelease() FAILED", err)
log.Info("doRelease() FAILED", err)
log.Info("doRelease() FAILED", err)
}
})
me.release.grid.NewButton("Find Next", func() {