show dev version

This commit is contained in:
Jeff Carr 2025-02-08 22:14:51 -06:00
parent dc905f7a39
commit e3d9280377
1 changed files with 5 additions and 6 deletions

View File

@ -4,8 +4,6 @@ import (
"fmt"
"net/http"
"strings"
"go.wit.com/log"
)
func indexHeader(w http.ResponseWriter) {
@ -39,8 +37,8 @@ func indexBodyStart(w http.ResponseWriter) {
fmt.Fprintln(w, " <th>Package (IPv6 only)</th>")
fmt.Fprintln(w, " <th>Documentation</th>")
fmt.Fprintln(w, " <th>Version</th>")
fmt.Fprintln(w, " <th>Age</th>")
fmt.Fprintln(w, " <th>Dev Version</th>")
fmt.Fprintln(w, " <th>Age</th>")
fmt.Fprintln(w, " <th>Description</th>")
// fmt.Fprintln(w, " <th>Authoritative sources (IPv6 only)</th>")
// fmt.Fprintln(w, " <th></th>")
@ -99,18 +97,19 @@ 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>")
var vtime, version string
var vtime, version, dver string
gourl = strings.TrimSpace(gourl)
if repo, ok := gitMap[gourl]; ok {
version = repo.GetLastTag()
age := repo.NewestAge()
vtime = formatDuration(age)
dver = repo.GetDevelVersion()
}
log.Info("gopath", gourl, "dur", vtime, "version", version)
// log.Info("gopath", gourl, "dur", vtime, "version", version)
fmt.Fprintln(w, " <td>"+version+"</td>") // version
fmt.Fprintln(w, " <td>"+dver+"</td>") // dev version
fmt.Fprintln(w, " <td>"+vtime+"</td>") // dev version
fmt.Fprintln(w, " <td></td>") // dev version
fmt.Fprintln(w, " <td>"+desc+"</td>")
// fmt.Fprintln(w, " <td> <a href=\"//"+gourl+"\">"+giturl+"</a></td>")
fmt.Fprintln(w, " </tr>")