From a6b9170ad0ae6ac3e7da794275d692f974ed2140 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 3 Dec 2024 03:18:58 -0600 Subject: move to protobuf --- human.go | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'human.go') diff --git a/human.go b/human.go index 50bbd51..12e3002 100644 --- a/human.go +++ b/human.go @@ -4,7 +4,6 @@ package repolist import ( "fmt" - "time" "go.wit.com/lib/gui/shell" ) @@ -13,14 +12,13 @@ import ( // https://pkg.go.dev/fmt has good references for Sprintf func (r *RepoRow) StandardHeader() string { lastTag := r.LastTag() - tag := r.Status.NewestTag() - gitAge, _ := tag.GetDate() - dur := time.Since(gitAge) + tag := r.pb.NewestTag() + dur := tag.GetAge() - target := r.Status.GetTargetVersion() - master := r.Status.GetMasterVersion() - devel := r.Status.GetDevelVersion() - user := r.Status.GetUserVersion() + target := r.pb.GetTargetVersion() + master := r.pb.GetMasterVersion() + devel := r.pb.GetDevelVersion() + user := r.pb.GetUserVersion() header := fmt.Sprintf("%-35s %5s %-10s %-10s %-20s %-20s %-20s %-15s", r.Name(), shell.FormatDuration(dur), @@ -85,14 +83,13 @@ func (v *RepoList) PrintReport(readonly string, onlydirty string, perfect string // makes a human readable thing for standard out. func (r *RepoRow) StandardReleaseHeader() string { lastTag := r.LastTag() - tag := r.Status.NewestTag() - gitAge, _ := tag.GetDate() - dur := time.Since(gitAge) - - curname := r.Status.GetCurrentBranchName() - master := r.Status.GetMasterVersion() - user := r.Status.GetUserVersion() - target := r.Status.GetTargetVersion() + tag := r.pb.NewestTag() + dur := tag.GetAge() + + curname := r.pb.GetCurrentBranchName() + master := r.pb.GetMasterVersion() + user := r.pb.GetUserVersion() + target := r.pb.GetTargetVersion() header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-20s %-20s %-15s", r.Name(), shell.FormatDuration(dur), curname, -- cgit v1.2.3