Skip to content

Commit

Permalink
docs: example を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
kokoichi206 committed Feb 12, 2023
1 parent 7279bc4 commit 6918446
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions util/stdout_format_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package util_test

import (
"github.com/android-project-46group/sgi-cli/util"
)

func ExamplePrintTable() {
var header []string
var data [][]string
header = []string{
"id",
"name",
}
data = append(data, []string{
"1",
"John",
})
data = append(data, []string{
"2",
"Doe",
})
util.PrintTable(header, data)

// Output:
// +----+------+
// | ID | NAME |
// +----+------+
// | 1 | John |
// | 2 | Doe |
// +----+------+
}

0 comments on commit 6918446

Please # to comment.