-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathprinting.go
More file actions
42 lines (39 loc) · 799 Bytes
/
printing.go
File metadata and controls
42 lines (39 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"fmt"
"os"
"text/tabwriter"
)
func newWriter() *tabwriter.Writer {
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
fmt.Fprintln(w, "ID\tName\tClass\tLevel\tCreated At\tUpdated At")
return w
}
//
// func printPlayer(x player.Player) {
// w := newWriter()
// defer w.Flush()
//
// printPlayerLine(w, x)
// }
//
// func printPlayerLine(w io.Writer, player player.Player) {
// fmt.Fprintf(w,
// "%d\t%s\t%s\t%d\t%s\t%s\n",
// player.ID,
// player.Name,
// player.Class,
// player.Level,
// player.CreatedAt.UTC().Format(time.RFC3339),
// player.UpdatedAt.UTC().Format(time.RFC3339),
// )
// }
//
// func printPlayers(xs []player.Player) {
// w := newWriter()
// defer w.Flush()
//
// for _, x := range xs {
// printPlayerLine(w, x)
// }
// }