From cfd6046978c3d7b5e3996706b32cd6487ac4b7e0 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 12 Feb 2025 10:35:50 -0600 Subject: [PATCH] handle primitive package logic --- findNext.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/findNext.go b/findNext.go index 388336e..6f4cd25 100644 --- a/findNext.go +++ b/findNext.go @@ -4,6 +4,7 @@ package main import ( "errors" "fmt" + "os" "path/filepath" "go.wit.com/log" @@ -79,8 +80,19 @@ func findNext() bool { continue } - if err := testGoDepsCheckOk(godepsNew, argv.Verbose); err != nil { - log.Info("CHECKING current repo deps failed", err) + if godepsNew == nil { + // don't check godepsNew, but check to make sure go mod tidy actually ran without error + cmd := []string{"go", "mod", "tidy"} + _, err := check.RunVerbose(cmd) + if err != nil { + log.Info("go mod tidy failed. this go package needs to be examined by hand as it doesn't appear to be primitive") + os.Exit(-1) + } + // if godepsNew == nil, then this go package is a primitive and there is no go.sum file + } else { + if err := testGoDepsCheckOk(godepsNew, argv.Verbose); err != nil { + log.Info("CHECKING current repo deps failed", err) + } continue } /*