mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 09:34:17 +02:00
add printer.ByteString() as shortcut
This commit is contained in:
@@ -22,10 +22,15 @@ type ByteSize struct {
|
||||
size uint64
|
||||
}
|
||||
|
||||
func (b *ByteSize) String() string {
|
||||
return humanize.Bytes(b.size)
|
||||
}
|
||||
|
||||
func Bytes(size int64) *ByteSize {
|
||||
return &ByteSize{size: uint64(size)}
|
||||
}
|
||||
|
||||
func (b *ByteSize) String() string {
|
||||
return humanize.Bytes(b.size)
|
||||
func ByteString(size int64) string {
|
||||
b := ByteSize{size: uint64(size)}
|
||||
return b.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user