Created
February 8, 2021 04:28
-
-
Save zacksleo/a1501c2f2531d94cc8488608bf1dd3ec to your computer and use it in GitHub Desktop.
Cli table for go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"github.com/tomlazar/table" | |
) | |
func main() { | |
tab := table.Table{ | |
Headers: []string{"姓名", "地址"}, | |
Rows: [][]string{ | |
{"1", "2"}, | |
{"3", "4"}, | |
{"3", "a longer piece of text that should stretch"}, | |
{"but this one is longer", "shorter now"}, | |
}, | |
} | |
tab.WriteTable(os.Stdout, nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment