summaryrefslogtreecommitdiff
path: root/goDep.redoGoMod.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-17 00:00:49 -0600
committerJeff Carr <[email protected]>2024-12-17 00:00:49 -0600
commitc53da5a9a1da1b29db24d4e1ce2b294514d99ac2 (patch)
treec39b33f43d5be87313b3c0aa0c7bb7c58b2f72b6 /goDep.redoGoMod.go
parenta115ba144b00dc0339a8cf7eae6bdf2aab5fb4b5 (diff)
smarter and faster mtime logic
Diffstat (limited to 'goDep.redoGoMod.go')
-rw-r--r--goDep.redoGoMod.go24
1 files changed, 2 insertions, 22 deletions
diff --git a/goDep.redoGoMod.go b/goDep.redoGoMod.go
index 59845af..633f07f 100644
--- a/goDep.redoGoMod.go
+++ b/goDep.redoGoMod.go
@@ -4,7 +4,6 @@ package gitpb
import (
"errors"
- "time"
)
// checks to see if the go.sum and go.mod files exist
@@ -24,7 +23,7 @@ func (repo *Repo) ValidGoSum() error {
}
/*
// todo: fix this
- mtime, err := repo.mtime("go.mod")
+ mtime, err := repo.Mtime("go.mod")
if err == nil {
return err
}
@@ -38,7 +37,7 @@ func (repo *Repo) ValidGoSum() error {
return errors.New("ValidGoSum() go.sum is missing")
}
/*
- mtime, err := repo.mtime("go.sum")
+ mtime, err := repo.Mtime("go.sum")
// todo: fix this
if err == nil {
return err
@@ -56,22 +55,3 @@ func (repo *Repo) GoDepsLen() int {
}
return len(repo.GoDeps.GoDeps)
}
-
-func (repo *Repo) LastGitPull() (time.Time, error) {
- return repo.mtime(".git/FETCH_HEAD")
-}
-
-func (repo *Repo) GoSumAge() (time.Duration, error) {
- var mtime time.Time
- var err error
- mtime, err = repo.mtime("go.sum")
- if err == nil {
- return time.Since(mtime), nil
- }
- mtime, err = repo.mtime("go.mod")
- if err == nil {
- return time.Since(mtime), nil
- }
- now := time.Now()
- return time.Since(now), errors.New(repo.GoPath + " go.mod missing")
-}