From 23a084d74c3ab54ab0e57588cfc0ff3193ce8abe Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sat, 31 Jan 2015 21:42:33 -0500 Subject: [PATCH] Move "Last Amt." column to end --- tablizer.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tablizer.go b/tablizer.go index c998fdd..8b26af1 100644 --- a/tablizer.go +++ b/tablizer.go @@ -33,7 +33,7 @@ func main() { scoresPath = "/home/bear/tildescores.txt" } - headers := []string{ "User", "Tildes", "Last Collected", "Last Amt.", "# Asks", "Avg." } + headers := []string{ "User", "Tildes", "Last Collected", "# Asks", "Avg.", "Last Amt." } scoresData := readData(scoresPath, "&^%") updatesData := readData(scoreDeltasPath, deltaDelimiter) @@ -147,14 +147,6 @@ func checkScoreDelta(scoreRows *[]Row, deltaRows *[]Row) *[]Row { u.LastScore = score u.Times++ } - - var lastIncStr string - if u.LastIncrement > -1 { - lastIncStr = strconv.Itoa(u.LastIncrement) - } else { - lastIncStr = "-" - } - r.Data = append(r.Data, lastIncStr) var asksStr string if u.Times > 0 { @@ -173,6 +165,14 @@ func checkScoreDelta(scoreRows *[]Row, deltaRows *[]Row) *[]Row { } r.Data = append(r.Data, avgStr) + var lastIncStr string + if u.LastIncrement > -1 { + lastIncStr = strconv.Itoa(u.LastIncrement) + } else { + lastIncStr = "-" + } + r.Data = append(r.Data, lastIncStr) + users[r.Data[0]] = u (*scoreRows)[i] = r }