Humanize byte size

License: MIT
Signed-off-by: Thomas Gardner <tmg@fastmail.com>
This commit is contained in:
Thomas Gardner 2016-02-10 20:07:31 +10:00 committed by David Dias
parent f988a54c1b
commit 288f7bc621

View File

@ -6,6 +6,7 @@ import (
"io"
"strings"
humanize "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/go-humanize"
cmds "github.com/ipfs/go-ipfs/commands"
corerepo "github.com/ipfs/go-ipfs/core/corerepo"
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
@ -156,8 +157,8 @@ var repoStatCmd = &cmds.Command{
}
out := fmt.Sprintf(
"Path: %s\nSize: %d bytes\nBlocks: %d\n",
stat.repoPath, stat.repoSize, stat.numBlocks)
"Path: %s\nSize: %s\nBlocks: %d\n",
stat.repoPath, humanize.Bytes(stat.repoSize), stat.numBlocks)
return strings.NewReader(out), nil
},