diff options
| author | Jeff Carr <[email protected]> | 2025-05-29 19:17:50 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-05-29 19:17:50 -0500 |
| commit | a29e10e9116f4d5ab80210b3eb8e25b674d3338f (patch) | |
| tree | b6182f8668da2dd246092f6fe6c7dad0093d3121 /main.go | |
| parent | 2b85f5e17dda4bea2b9403668c66e291dfa67591 (diff) | |
fixes due to 'go mod' behavior changesv0.0.90v0.0.89v0.0.88v0.0.87v0.0.86v0.0.85v0.0.84v0.0.83v0.0.82v0.0.81v0.0.80v0.0.79v0.0.78v0.0.77v0.0.76
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -25,7 +25,6 @@ var configSave bool func main() { var check *gitpb.Repo - log.Info("go-mod-clean version", VERSION, "built on", BUILDTIME) pp = arg.MustParse(&argv) if argv.Bash { @@ -36,6 +35,8 @@ func main() { argv.doBashAuto() os.Exit(0) } + + log.Info("go-mod-clean version", VERSION, "built on", BUILDTIME) // load the ~/.config/forge/ config // this lets you configure repos you have read/write access too forge = forgepb.InitPB() // todo: make this scan only if pb file not found @@ -48,8 +49,9 @@ func main() { } // deletes all the git notes - if argv.Purge { - purgeNotes(check) + if argv.Purge != nil { + purgeNotes(check) // purges all the 'git notes' + eraseGoMod(check) // erase the go.mod and go.sum files okExit(check, "notes gone") } @@ -61,14 +63,14 @@ func main() { okExit(check, "go.mod and go.sum restored from ~/go/pkg/mod/") } - if argv.Strict { + if argv.Strict != nil { log.Info("Starting --strict mode") if err := doStrict(check); err != nil { badExit(check, err) } okExit(check, "go.mod seems clean") } - if argv.Smart { + if argv.Smart != nil { // best effort if err := doSmart(check); err != nil { // badExit(check, err) @@ -93,13 +95,13 @@ func findPwdRepo() *gitpb.Repo { if strings.HasPrefix(pwd, forge.GetGoSrc()) { gopath := strings.TrimPrefix(pwd, forge.GetGoSrc()) gopath = strings.Trim(gopath, "/") - log.Info("findRepo() trying gopath", gopath) check = forge.FindByGoPath(gopath) if check != nil { - log.Info("findRepo() worked", check.GetGoPath()) + log.Info(check.GetGoPath(), "was found ok in forge") return check } } + log.Info("findRepo() forge could not find GO path:", pwd) return nil } |
