mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 09:44:17 +02:00
replace & with new()
This commit is contained in:
@@ -27,7 +27,7 @@ func (b *ByteSize) String() string {
|
||||
}
|
||||
|
||||
func Bytes(size int64) *ByteSize {
|
||||
return &ByteSize{size: uint64(size)}
|
||||
return new(ByteSize{size: uint64(size)})
|
||||
}
|
||||
|
||||
func ByteString(size int64) string {
|
||||
|
||||
@@ -43,7 +43,7 @@ type Table struct {
|
||||
}
|
||||
|
||||
func NewTable(conf *cfg.Config, columns, rows int) *Table {
|
||||
table := Table{Mode: conf.Output, maxwidth: cfg.GetTermWidth()}
|
||||
table := new(Table{Mode: conf.Output, maxwidth: cfg.GetTermWidth()})
|
||||
|
||||
table.Headers = make([]string, columns)
|
||||
table.RawHeaders = make([]string, columns)
|
||||
@@ -51,14 +51,14 @@ func NewTable(conf *cfg.Config, columns, rows int) *Table {
|
||||
table.lenHeaders = make([]int, columns)
|
||||
table.alignInts = conf.AlignInts
|
||||
|
||||
return &table
|
||||
return table
|
||||
}
|
||||
|
||||
func NewTableEmpty(conf *cfg.Config) *Table {
|
||||
table := Table{Mode: conf.Output, maxwidth: cfg.GetTermWidth()}
|
||||
table := new(Table{Mode: conf.Output, maxwidth: cfg.GetTermWidth()})
|
||||
table.alignInts = conf.AlignInts
|
||||
|
||||
return &table
|
||||
return table
|
||||
}
|
||||
|
||||
func (table *Table) WithHeaders(headers ...string) *Table {
|
||||
|
||||
Reference in New Issue
Block a user