summaryrefslogtreecommitdiff
path: root/indexHtml.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-27 20:43:23 -0600
committerJeff Carr <[email protected]>2024-12-28 20:01:58 -0600
commit7a8f54a192640c1a55db23f11ed8d8ca29cd1c22 (patch)
treedad0478cf615ef7b57fd587ca27fb6976b1238a3 /indexHtml.go
parent37500b94969863a210c5f1cf334491d1f9b57d14 (diff)
compute the timestamps each time
Diffstat (limited to 'indexHtml.go')
-rw-r--r--indexHtml.go15
1 files changed, 4 insertions, 11 deletions
diff --git a/indexHtml.go b/indexHtml.go
index f0c0fd3..71108ee 100644
--- a/indexHtml.go
+++ b/indexHtml.go
@@ -99,19 +99,12 @@ func indexBodyRepo(w http.ResponseWriter, gourl string, giturl string, desc stri
// fmt.Fprintln(w, " <td>"+gourl+"</td>")
fmt.Fprintln(w, " <td> <a href=\"//"+gourl+"\">"+gourl+"</a></td>")
fmt.Fprintln(w, " <td> <a href=\"//pkg.go.dev/"+gourl+"\"> <img src=\"goReference.svg\" alt=\"pkg.go.dev\" /> </a> </td>")
- // for i, s := range versionMap {
- // log.Println("found i =", i, "with", "s =", s)
- // }
var vtime, version string
gourl = strings.TrimSpace(gourl)
- if tmp, ok := versionMap[gourl]; ok {
- // log.Info("gopath", gopath, "tmp", tmp)
- parts := strings.Fields(tmp)
- if len(parts) == 2 {
- // log.Info("GOT HERE gopath", gopath, "tmp", tmp)
- version = parts[0]
- vtime = parts[1]
- }
+ if repo, ok := gitMap[gourl]; ok {
+ version = repo.GetLastTag()
+ age := repo.NewestAge()
+ vtime = formatDuration(age)
}
log.Info("gopath", gourl, "dur", vtime, "version", version)