diff options
| author | Jeff Carr <[email protected]> | 2025-05-23 17:40:23 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-05-23 17:40:23 -0500 |
| commit | 2b85f5e17dda4bea2b9403668c66e291dfa67591 (patch) | |
| tree | d69031d70664e52326a0a1cbf0ce5eaefad9e952 | |
| parent | 4bbf8c76bc83cc6ed942be1f13a944e40a4924df (diff) | |
remove attempts to set go version
| -rw-r--r-- | doStrict.go | 2 | ||||
| -rw-r--r-- | main.go | 2 | ||||
| -rw-r--r-- | redoGoMod.go | 33 |
3 files changed, 2 insertions, 35 deletions
diff --git a/doStrict.go b/doStrict.go index 34cffb5..a1d1f28 100644 --- a/doStrict.go +++ b/doStrict.go @@ -78,7 +78,7 @@ func doStrict(repo *gitpb.Repo) error { } os.Unsetenv("GO111MODULE") - if result, err := repo.RunQuiet([]string{"go", "mod", "tidy", "-go=" + golangVersion}); err != nil { + if result, err := repo.RunQuiet([]string{"go", "mod", "tidy"}); err != nil { // I guess the thing to do, if go mod tidy fails, is to just leave the repo alone // it's either primitive or could be a go support project but not in go for _, line := range result.Stdout { @@ -17,8 +17,6 @@ var BUILDTIME string // used for shell auto completion var ARGNAME string = "go-mod-clean" -var golangVersion string = "1.22" - var pp *arg.Parser var forge *forgepb.Forge diff --git a/redoGoMod.go b/redoGoMod.go index 278b5bc..1cf50dc 100644 --- a/redoGoMod.go +++ b/redoGoMod.go @@ -5,7 +5,6 @@ package main import ( "fmt" "os" - "strings" "github.com/go-cmd/cmd" "go.wit.com/lib/protobuf/gitpb" @@ -31,7 +30,7 @@ func setGoVersion(repo *gitpb.Repo, version string) error { } func goTidy(fullpath string) (cmd.Status, error) { - if result, err := runVerbose(fullpath, []string{"go", "mod", "tidy", "-go=" + golangVersion}); err == nil { + if result, err := runVerbose(fullpath, []string{"go", "mod", "tidy"}); err == nil { return result, nil } else { return result, err @@ -51,20 +50,6 @@ func redoGoMod(repo *gitpb.Repo) error { return err } - if result, err := goTidy(repo.FullPath); err != nil { - if tinyFixer(result) { - if _, err := goTidy(repo.FullPath); err != nil { - return err - } - } - } - - // most things should build with golang after 1.21 // todo: allow this to be set somewhere - if err := setGoVersion(repo, golangVersion); err != nil { - log.Warn(repo.GetGoPath(), "go mod edit failed", err) - return err - } - // parse the go.mod and go.sum files if repo.ParseGoSum() { return nil @@ -72,19 +57,3 @@ func redoGoMod(repo *gitpb.Repo) error { return fmt.Errorf("check.ParseGoSum() failed") } - -func tinyFixer(result cmd.Status) bool { - for _, line := range result.Stdout { - if strings.Contains(line, "requires go@") { - log.Info("tinyFixer:", line) - parts := strings.Split(line, "requires go@") - if len(parts) == 2 { - parts = strings.Split(parts[1], ",") - golangVersion = parts[0] - return true - } - log.Info("tinyFixer:", line, "golangVersion", golangVersion) - } - } - return false -} |
