summaryrefslogtreecommitdiff
path: root/isPrimitive.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-13 00:19:33 -0600
committerJeff Carr <[email protected]>2024-12-13 00:19:33 -0600
commitc5f7570834f092608cd2137e966399f44aa02d36 (patch)
treed0aee40b2fffc1729b654c9cfbe65a4a0183d768 /isPrimitive.go
parentadddfad2b7418dcaec4bd6c97219b72774fe0cac (diff)
working on go-mod-clean
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'isPrimitive.go')
-rw-r--r--isPrimitive.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/isPrimitive.go b/isPrimitive.go
index 3870343..0455799 100644
--- a/isPrimitive.go
+++ b/isPrimitive.go
@@ -34,7 +34,7 @@ func (repo *Repo) IsPrimitive() (bool, error) {
for scanner.Scan() {
line := strings.TrimSpace(scanner.Text())
- parts := strings.Split(line, " ")
+ parts := strings.Fields(line)
log.Log(GITPB, " gomod:", parts)
if len(parts) >= 1 {
log.Log(GITPB, " gomod: part[0] =", parts[0])
@@ -42,7 +42,12 @@ func (repo *Repo) IsPrimitive() (bool, error) {
log.Log(GITPB, " should return false here")
return false, errors.New("go.mod file is not primative")
}
-
+ if parts[0] == "go" {
+ if parts[1] != "1.20" {
+ log.Log(GITPBWARN, "go not set to 1.20 for", repo.GoPath)
+ return false, errors.New("go not set to 1.20 for " + repo.GoPath)
+ }
+ }
}
}
repo.GoPrimitive = true