File tree Expand file tree Collapse file tree 5 files changed +55
-1
lines changed Expand file tree Collapse file tree 5 files changed +55
-1
lines changed Original file line number Diff line number Diff line change 133
133
* [ dateparse] ( https://darjun.github.io/2021/06/24/godailylib/dateparse )
134
134
日期时间字符串解析库。
135
135
* [ resty] ( https://darjun.github.io/2021/06/26/godailylib/resty )
136
- HTTP client。
136
+ HTTP client。
137
+ * [ termtables] ( https://darjun.github.io/2021/06/29/godailylib/termtables/ )
138
+ 控制台输出表格。
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+ "github.com/scylladb/termtables"
6
+ )
7
+
8
+ func main () {
9
+ t := termtables .CreateTable ()
10
+ t .AddHeaders ("User" , "Age" )
11
+ t .AddRow ("dj" , 18 )
12
+ t .AddRow ("darjun" , 30 )
13
+ fmt .Println (t .Render ())
14
+ }
Original file line number Diff line number Diff line change
1
+ module github.com/darjun/go-daily-lib/termtables
2
+
3
+ go 1.16
4
+
5
+ require (
6
+ github.com/apcera/termtables v0.0.0-20170405184538-bcbc5dc54055 // indirect
7
+ github.com/mattn/go-runewidth v0.0.13 // indirect
8
+ github.com/scylladb/termtables v1.0.0 // indirect
9
+ )
Original file line number Diff line number Diff line change
1
+ github.com/apcera/termtables v0.0.0-20170405184538-bcbc5dc54055 h1:IkPAzP+QjchKXXFX6LCcpDKa89b/e/0gPCUbQGWtUUY =
2
+ github.com/apcera/termtables v0.0.0-20170405184538-bcbc5dc54055 /go.mod h1:8mHYHlOef9UC51cK1/WRvE/iQVM8O8QlYFa8eh8r5I8 =
3
+ github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU =
4
+ github.com/mattn/go-runewidth v0.0.13 /go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w =
5
+ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY =
6
+ github.com/rivo/uniseg v0.2.0 /go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc =
7
+ github.com/scylladb/termtables v1.0.0 h1:uUnesUY4V1VPCotpOQLb1LjTXVvzwy7Ramx8K8+w+8U =
8
+ github.com/scylladb/termtables v1.0.0 /go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg =
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+
6
+ "github.com/scylladb/termtables"
7
+ )
8
+
9
+ func main () {
10
+ t := termtables .CreateTable ()
11
+ t .AddHeaders ("User" , "Age" )
12
+ t .AddRow ("dj" , 18 )
13
+ t .AddRow ("darjun" , 30 )
14
+ fmt .Println ("HTML:" )
15
+ t .SetModeHTML ()
16
+ fmt .Println (t .Render ())
17
+
18
+ fmt .Println ("Markdown:" )
19
+ t .SetModeMarkdown ()
20
+ fmt .Println (t .Render ())
21
+ }
You can’t perform that action at this time.
0 commit comments