Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Michael Muré <batolettre@gmail.com>
  • Loading branch information
MichaelMure committed Feb 1, 2018
1 parent cd8a311 commit 7538f25
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/commands/files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
gopath "path"
"strings"

"gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize"

bservice "github.com/ipfs/go-ipfs/blockservice"
oldcmds "github.com/ipfs/go-ipfs/commands"
lgc "github.com/ipfs/go-ipfs/commands/legacy"
Expand All @@ -24,6 +22,7 @@ import (
ft "github.com/ipfs/go-ipfs/unixfs"
uio "github.com/ipfs/go-ipfs/unixfs/io"

humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize"
cmds "gx/ipfs/QmPq2D7Yoyev7yeMuMnkEYBqmQuUu5kb91UXPPoiik1Xyp/go-ipfs-cmds"
logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash"
Expand Down Expand Up @@ -73,7 +72,7 @@ var hashOption = cmdkit.StringOption("hash", "Hash function to use. Will set Cid

var formatError = errors.New("Format was set by multiple options. Only one format option is allowed")

type StatOutput struct {
type statOutput struct {
Hash string
Size uint64
CumulativeSize uint64
Expand Down Expand Up @@ -158,7 +157,7 @@ var filesStatCmd = &cmds.Command{
},
Encoders: cmds.EncoderMap{
cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error {
out, ok := v.(*StatOutput)
out, ok := v.(*statOutput)
if !ok {
return e.TypeErr(out, v)
}
Expand All @@ -183,7 +182,7 @@ var filesStatCmd = &cmds.Command{
return nil
}),
},
Type: StatOutput{},
Type: statOutput{},
}

func moreThanOne(a, b, c bool) bool {
Expand All @@ -209,7 +208,7 @@ func statGetFormatOptions(req *cmds.Request) (string, error) {
}
}

func statNode(nd ipld.Node) (*StatOutput, error) {
func statNode(nd ipld.Node) (*statOutput, error) {
c := nd.Cid()

cumulsize, err := nd.Size()
Expand All @@ -234,15 +233,15 @@ func statNode(nd ipld.Node) (*StatOutput, error) {
return nil, fmt.Errorf("unrecognized node type: %s", d.GetType())
}

return &StatOutput{
return &statOutput{
Hash: c.String(),
Blocks: len(nd.Links()),
Size: d.GetFilesize(),
CumulativeSize: cumulsize,
Type: ndtype,
}, nil
case *dag.RawNode:
return &StatOutput{
return &statOutput{
Hash: c.String(),
Blocks: 0,
Size: cumulsize,
Expand Down

0 comments on commit 7538f25

Please sign in to comment.