We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6a5f63 commit fd4d261Copy full SHA for fd4d261
main.go
@@ -246,14 +246,23 @@ func printTable(languages Languages) {
246
{
247
Name: "Lines",
248
Align: text.AlignRight,
249
+ Transformer: func(val interface{}) string {
250
+ return p.Sprintf("%d", val)
251
+ },
252
+ TransformerFooter: func(val interface{}) string {
253
254
255
},
256
})
257
258
// Append rows in sorted order
259
+ sumLines := 0
260
for _, pair := range pairs {
- num := p.Sprintf("%d", pair.Value)
- t.AppendRow(table.Row{pair.Key, num})
261
+ sumLines += pair.Value
262
+ t.AppendRow(table.Row{pair.Key, pair.Value})
263
}
264
+
265
+ t.AppendFooter(table.Row{"Total", sumLines})
266
t.Render()
267
268
0 commit comments