diff --git a/client.go b/client.go index c517b45..8ebf521 100644 --- a/client.go +++ b/client.go @@ -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") diff --git a/go.mod b/go.mod index 2670be3..7b8d0e3 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/tardisx/netgiv go 1.17 require ( + github.com/dustin/go-humanize v1.0.0 // indirect github.com/h2non/filetype v1.1.3 // indirect github.com/mattn/go-isatty v0.0.14 // indirect golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect diff --git a/go.sum b/go.sum index 3816ca2..8f594f0 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=