github.com/fzfile/BaiduPCS-Go@v0.0.0-20200606205115-4408961cf336/pcstable/pcstable.go (about) 1 // Package pcstable 格式化表格包 2 package pcstable 3 4 import ( 5 "github.com/olekukonko/tablewriter" 6 "io" 7 ) 8 9 // PCSTable 封装 tablewriter.Table 10 type PCSTable struct { 11 *tablewriter.Table 12 } 13 14 // NewTable 预设了一些配置 15 func NewTable(wt io.Writer) PCSTable { 16 tb := tablewriter.NewWriter(wt) 17 tb.SetAutoWrapText(false) 18 tb.SetBorder(false) 19 tb.SetHeaderLine(false) 20 tb.SetColumnSeparator("") 21 return PCSTable{tb} 22 }