summaryrefslogtreecommitdiff
path: root/redoGoMod.go
diff options
context:
space:
mode:
Diffstat (limited to 'redoGoMod.go')
-rw-r--r--redoGoMod.go33
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
-}