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 /redoGoMod.go | |
| parent | 4bbf8c76bc83cc6ed942be1f13a944e40a4924df (diff) | |
remove attempts to set go version
Diffstat (limited to 'redoGoMod.go')
| -rw-r--r-- | redoGoMod.go | 33 |
1 files changed, 1 insertions, 32 deletions
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 -} |
