forked from TrueCloudLab/restic
Add comments
This commit is contained in:
parent
02f7bb0d4c
commit
3601c39177
1 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Table contains data for a table to be printed.
|
||||||
type Table struct {
|
type Table struct {
|
||||||
Header string
|
Header string
|
||||||
Rows [][]interface{}
|
Rows [][]interface{}
|
||||||
|
@ -13,12 +14,14 @@ type Table struct {
|
||||||
RowFormat string
|
RowFormat string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewTable initializes a new Table.
|
||||||
func NewTable() Table {
|
func NewTable() Table {
|
||||||
return Table{
|
return Table{
|
||||||
Rows: [][]interface{}{},
|
Rows: [][]interface{}{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write prints the table to w.
|
||||||
func (t Table) Write(w io.Writer) error {
|
func (t Table) Write(w io.Writer) error {
|
||||||
_, err := fmt.Fprintln(w, t.Header)
|
_, err := fmt.Fprintln(w, t.Header)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -39,4 +42,5 @@ func (t Table) Write(w io.Writer) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TimeFormat is the format used for all timestamps printed by restic.
|
||||||
const TimeFormat = "2006-01-02 15:04:05"
|
const TimeFormat = "2006-01-02 15:04:05"
|
||||||
|
|
Loading…
Add table
Reference in a new issue