From 7244a636a5fa491d01fee5fac91fd2d1d1623856 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 7 Nov 2024 03:41:26 -0600 Subject: [PATCH] try to debian package --- human.go | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/human.go b/human.go index 79c218b..d816d71 100644 --- a/human.go +++ b/human.go @@ -31,12 +31,6 @@ func (r *RepoRow) StandardHeader() string { return header } -// send stuff to the socket and stdout -func msg(w http.ResponseWriter, s string) { - log.Info(s) - fmt.Fprintln(w, s) -} - func ReportHeader() string { return fmt.Sprintf("%-35s %5s %-10s %-10s %-20s %-20s %-20s %-15s", "REPO", "AGE", @@ -48,7 +42,7 @@ func ReportHeader() string { func (v *RepoList) PrintReport(w http.ResponseWriter, readonly string, onlydirty string, perfect string) { var count int - msg(w, ReportHeader()) + log.Info(ReportHeader()) loop := v.ReposSortByName() for loop.Scan() { @@ -58,14 +52,14 @@ func (v *RepoList) PrintReport(w http.ResponseWriter, readonly string, onlydirty header := repo.StandardHeader() if onlydirty == "true" { if repo.CheckDirty() { - msg(w, header+"") + log.Info(header+"") } continue } if repo.ReadOnly() { if readonly == "true" { - msg(w, header+"readonly") + log.Info(header+"readonly") } continue } @@ -75,16 +69,16 @@ func (v *RepoList) PrintReport(w http.ResponseWriter, readonly string, onlydirty } } if repo.State() != "merge to main" { - msg(w, header+"") + log.Info(header+"") continue } if repo.CheckDirty() { - msg(w, header+"") + log.Info(header+"") continue } - msg(w, header+"") + log.Info(header+"") } - msg(w, fmt.Sprintf("EVERYTHING WORKED repo count = %d", count)) + log.Info(fmt.Sprintf("EVERYTHING WORKED repo count = %d", count)) } // makes a human readable thing for standard out. @@ -118,7 +112,7 @@ func ReleaseReportHeader() string { func (v *RepoList) PrintReleaseReport(w http.ResponseWriter, readonly string, perfect string) { var count int - msg(w, ReleaseReportHeader()) + log.Info(ReleaseReportHeader()) loop := v.ReposSortByName() for loop.Scan() { @@ -135,7 +129,7 @@ func (v *RepoList) PrintReleaseReport(w http.ResponseWriter, readonly string, pe } count += 1 header := repo.StandardReleaseHeader() - msg(w, header) + log.Info(header) } - msg(w, fmt.Sprintf("total repo count = %d", count)) + log.Info(fmt.Sprintf("total repo count = %d", count)) }