From 3601c39177d1db9a8e1686760ec54140b751d33b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 27 Sep 2016 20:22:01 +0200 Subject: [PATCH] Add comments --- src/cmds/restic/table.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmds/restic/table.go b/src/cmds/restic/table.go index 00da32198..7a5d17a53 100644 --- a/src/cmds/restic/table.go +++ b/src/cmds/restic/table.go @@ -6,6 +6,7 @@ import ( "strings" ) +// Table contains data for a table to be printed. type Table struct { Header string Rows [][]interface{} @@ -13,12 +14,14 @@ type Table struct { RowFormat string } +// NewTable initializes a new Table. func NewTable() Table { return Table{ Rows: [][]interface{}{}, } } +// Write prints the table to w. func (t Table) Write(w io.Writer) error { _, err := fmt.Fprintln(w, t.Header) if err != nil { @@ -39,4 +42,5 @@ func (t Table) Write(w io.Writer) error { return nil } +// TimeFormat is the format used for all timestamps printed by restic. const TimeFormat = "2006-01-02 15:04:05"