summaryrefslogtreecommitdiff
path: root/finalGoDepsCheckOk.go
diff options
context:
space:
mode:
Diffstat (limited to 'finalGoDepsCheckOk.go')
-rw-r--r--finalGoDepsCheckOk.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/finalGoDepsCheckOk.go b/finalGoDepsCheckOk.go
new file mode 100644
index 0000000..6b0c2a1
--- /dev/null
+++ b/finalGoDepsCheckOk.go
@@ -0,0 +1,42 @@
+package main
+
+import (
+ "errors"
+ "fmt"
+ "os"
+ "path/filepath"
+
+ "go.wit.com/lib/ENV"
+ "go.wit.com/lib/protobuf/gitpb"
+ "go.wit.com/log"
+)
+
+func finalGoDepsCheckOk(check *gitpb.Repo) error {
+ data, _ := os.ReadFile(filepath.Join(check.FullPath, "go.mod"))
+ log.Info(string(data))
+
+ err := me.forge.FinalGoDepsCheckOk(check)
+ if err == nil {
+ log.Info("FINDNEXT: forge.FinalGoDepsCheck(check) worked!")
+ return nil
+ }
+ log.Printf("FINDNEXT: forge.FinalGoDepsCheck(check) err (%v)\n", err)
+ return err
+}
+
+func testGoDepsCheckOk(godeps *gitpb.GoDeps) error {
+ if godeps == nil {
+ return errors.New("testGoDepsCheckOk() godeps == nil")
+ }
+ all := godeps.SortByGoPath()
+ for all.Scan() {
+ depRepo := all.Next()
+ fullpath := filepath.Join(ENV.Get("gopath"), depRepo.GoPath)
+ found := me.found.FindByFullPath(fullpath)
+ if found == nil {
+ continue
+ }
+ return fmt.Errorf("testGoDepsCheckOk() dep is being upgraded %s", depRepo.GoPath)
+ }
+ return nil
+}