summaryrefslogtreecommitdiff
path: root/goConfig.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-03 00:34:55 -0600
committerJeff Carr <[email protected]>2024-12-03 00:34:55 -0600
commit283bd90e91d22e107cff71fcc613b8d646784aba (patch)
treeff26af5a12c12685f42c713b164b62e35402631b /goConfig.go
parentd5c394d3c3894a141d5848483102433a30e1a2db (diff)
lots more moved to using the protobufv0.22.24v0.22.23
Diffstat (limited to 'goConfig.go')
-rw-r--r--goConfig.go41
1 files changed, 2 insertions, 39 deletions
diff --git a/goConfig.go b/goConfig.go
index 6f34cba..c29e787 100644
--- a/goConfig.go
+++ b/goConfig.go
@@ -3,48 +3,10 @@ package repostatus
// does processing on the go.mod and go.sum files
import (
- "bufio"
- "errors"
- "os"
- "path/filepath"
- "strings"
-
"go.wit.com/log"
)
-// Detect a 'Primative' package. Sets the isPrimative flag
-// will return true if the repo is truly not dependent on _anything_ else
-// like spew or lib/widget
-// it assumes go mod ran init and tidy ran without error
-func (rs *RepoStatus) isPrimativeGoMod() (bool, error) {
- // go mod init & go mod tidy ran without errors
- log.Log(REPO, "isPrimativeGoMod()", rs.realPath.String())
- tmp := filepath.Join(rs.realPath.String(), "go.mod")
- gomod, err := os.Open(tmp)
- if err != nil {
- log.Log(REPO, "missing go.mod", rs.realPath.String())
- rs.goConfig = nil
- return false, err
- }
- defer gomod.Close()
-
- scanner := bufio.NewScanner(gomod)
- for scanner.Scan() {
- line := strings.TrimSpace(scanner.Text())
-
- parts := strings.Split(line, " ")
- log.Log(REPO, " gomod:", parts)
- if len(parts) >= 1 {
- log.Log(REPO, " gomod: part[0] =", parts[0])
- if parts[0] == "require" {
- log.Log(REPO, " should return false here")
- return false, errors.New("go.mod file is not primative")
- }
-
- }
- }
- return true, nil
-}
+/*
// readGoMod reads and parses the go.sum file
// saves the config information in *Repo.goConfig
@@ -105,6 +67,7 @@ func (rs *RepoStatus) parseGoSum() (bool, error) {
func (rs *RepoStatus) GoConfig() map[string]string {
return rs.goConfig
}
+*/
// for now, even check cmd.Exit
func (rs *RepoStatus) strictRun(cmd []string) (bool, error) {