blob: cd38c9a3174147b4f44f248b733fc4e8914cdd7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package printer
import (
"io"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/mauricioabreu/golings/src/exercises"
)
func PrintList(o io.Writer, exs []exercises.Exercise) {
t := table.NewWriter()
t.SetOutputMirror(o)
t.AppendHeader(table.Row{"Name", "Path", "State"})
for _, ex := range exs {
t.AppendRow(table.Row{ex.Name, ex.Path, ex.State()})
}
t.Render()
}
|