summaryrefslogtreecommitdiff
path: root/scan.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-30 23:55:04 -0600
committerJeff Carr <[email protected]>2024-01-30 23:55:04 -0600
commit6d59e0f0f7db343b00748a98e19286994fcbf19f (patch)
treef539294e6a4ef8ac48f50ae3ac388573ec992cf8 /scan.go
parentd18a8018cb95cd3218226639e6afa5b4e3f51af0 (diff)
more code cleanups
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'scan.go')
-rw-r--r--scan.go82
1 files changed, 0 insertions, 82 deletions
diff --git a/scan.go b/scan.go
index e0c9761..0818c85 100644
--- a/scan.go
+++ b/scan.go
@@ -65,88 +65,6 @@ func (r *repo) newScan() bool {
return false
}
-func (r *repo) getGoSumStatus() string {
- return r.goSumStatus.String()
-}
-
-func (r *repo) setGoSumStatus(s string) {
- r.goSumStatus.SetLabel(s)
- r.status.SetGoSumStatus(s)
-}
-
-func (r *repo) checkDirty() bool {
- if r.status.CheckDirty() {
- log.Info("dirty repo:", r.status.String(), r.getGoSumStatus())
- r.setGoSumStatus("DIRTY")
- return true
- }
- return false
-}
-
-func (r *repo) checkSafeGoSumRemake() {
- if ok, bad := r.status.CheckSafeGoSumRemake(); ok {
- log.Info("checkSafeGoSumRemake() is safe to redo")
- r.setGoSumStatus("SAFE")
- r.status.MakeRedomod()
- } else {
- log.Info("checkSafeGoSumRemake() is not safe. problems:", bad)
- r.setGoSumStatus("BAD DEP")
- }
-}
-
-func scanGoSum() {
- for _, repo := range me.allrepos {
- latestversion := repo.status.GetLastTagVersion()
- if repo.getGoSumStatus() == "BAD" {
- continue
- }
- if repo.getGoSumStatus() == "DIRTY" {
- continue
- }
- if repo.status.CheckPrimativeGoMod() {
- log.Info("PRIMATIVE repo:", latestversion, repo.status.String())
- repo.setGoSumStatus("PRIMATIVE")
- continue
- }
- if repo.checkDirty() {
- log.Info("dirty repo:", latestversion, repo.status.String())
- log.Info("dirty repo.getGoSumStatus =", repo.getGoSumStatus())
- repo.setGoSumStatus("DIRTY")
-
- // release.repo.SetValue(repo.status.String())
- // release.status.SetValue("dirty")
- // release.notes.SetValue("You must commit your changes\nbefore you can continue")
- // release.current = repo
- // release.openrepo.Enable()
- continue
- }
- if ok, missing := repo.status.CheckGoSum(); ok {
- log.Info("repo has go.sum requirements that are clean")
- repo.setGoSumStatus("CLEAN")
- } else {
- log.Info("repo has go.sum requirements that are screwed up. missing:", missing)
- repo.setGoSumStatus("BAD")
-
- // release.repo.SetValue(repo.status.String())
- // release.status.SetValue("bad")
- // release.notes.SetValue("the go.sum file is wrong")
- // release.current = repo
- // release.openrepo.Enable()
- continue
- }
- status := repo.dirtyLabel.String()
- if status == "PERFECT" {
- continue
- } else {
- repo.status.Update()
- repo.newScan()
- }
-
- log.Info("repo:", latestversion, status, repo.status.String())
- }
- log.Info("scanGoSum() did everything, not sure what to do next")
-}
-
// timeFunction takes a function as an argument and returns the execution time.
func timeFunction(f func()) time.Duration {
startTime := time.Now() // Record the start time