Make sizes more human friendly

This commit is contained in:
2022-01-15 23:10:46 +10:30
parent e3cfa6f309
commit 448caafd6b
3 changed files with 5 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import (
"net"
"os"
"github.com/dustin/go-humanize"
"github.com/tardisx/netgiv/secure"
)
@@ -64,7 +65,7 @@ func (c *Client) Connect() error {
if err != nil {
panic(err)
}
log.Printf("%d: %s (%d bytes)", listPacket.Id, listPacket.Kind, listPacket.FileSize)
log.Printf("%d: %s (%s)", listPacket.Id, listPacket.Kind, humanize.Bytes(uint64(listPacket.FileSize)))
}
conn.Close()
log.Printf("done listing")