go-mod-clean/all.go

33 lines
1.2 KiB
Go
Raw Normal View History

2024-12-13 02:21:25 -06:00
package main
import (
"fmt"
)
// rethink this. do not run on non-master git branches
func doAll() {
if argv.All {
if forge.IsGoWork() {
var warning []string
warning = append(warning, "go-mod-clean --recursive may not work unless you are in ~/go/src")
warning = append(warning, "you can continue anyway, but it hasn't been tested as much.")
simpleStdin(true, warning)
}
var warning []string
warning = append(warning, "go-mod-clean will recreate go.mod and go.sum")
warning = append(warning, "because you have selected --recursive")
warning = append(warning, "this will redo _every_ repo. This is probably fine.")
warning = append(warning, fmt.Sprintf("You have %d total repositories in %s", forge.Repos.Len(), forge.GetGoSrc()))
warning = append(warning, "")
warning = append(warning, "However, this will also, at times, do:")
warning = append(warning, "")
warning = append(warning, "rm -rf ~/go/pkg/")
warning = append(warning, "rm -rf ~/.config/go-build/")
warning = append(warning, "")
warning = append(warning, "Which is also probably fine, but will clear all your build cache and go mod cache")
warning = append(warning, "")
simpleStdin(false, warning)
// purgeGoCaches()
}
}