6
"github.com/gosuri/uitable"
10
Name, Birthday, Bio string
13
var hackers = []hacker{
14
{"Ada Lovelace", "December 10, 1815", "Ada was a British mathematician and writer, chiefly known for her work on Charles Babbage's early mechanical general-purpose computer, the Analytical Engine"},
15
{"Alan Turing", "June 23, 1912", "Alan was a British pioneering computer scientist, mathematician, logician, cryptanalyst and theoretical biologist"},
19
table := uitable.New()
20
table.MaxColWidth = 50
22
fmt.Println("==> List")
23
table.AddRow("NAME", "BIRTHDAY", "BIO")
24
for _, hacker := range hackers {
25
table.AddRow(hacker.Name, hacker.Birthday, hacker.Bio)
29
fmt.Print("\n==> Details\n")
31
table.MaxColWidth = 80
33
for _, hacker := range hackers {
34
table.AddRow("Name:", hacker.Name)
35
table.AddRow("Birthday:", hacker.Birthday)
36
table.AddRow("Bio:", hacker.Bio)
37
table.AddRow("") // blank