@cryptotaxi247 / kubo / commits / cac995e70

cleaning

License: MIT Signed-off-by: Michael Muré <batolettre@gmail.com>

Michael Muré committed Feb 1, 2018 at 13:06 UTC cac995e704c65e17e2c706cc2e56f11694316503
1 file changed +7 -8
core/commands/files/files.go
+7 -8
@@ -10,8 +10,6 @@ import (
10 gopath "path"
11 "strings"
12
13 - "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize"
14 -
13 bservice "github.com/ipfs/go-ipfs/blockservice"
14 oldcmds "github.com/ipfs/go-ipfs/commands"
15 lgc "github.com/ipfs/go-ipfs/commands/legacy"
@@ -24,6 +22,7 @@ import (
22 ft "github.com/ipfs/go-ipfs/unixfs"
23 uio "github.com/ipfs/go-ipfs/unixfs/io"
24
25 + humanize "gx/ipfs/QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K/go-humanize"
26 cmds "gx/ipfs/QmZ9hww8R3FKrDRCYPxhN13m6XgjPDpaSvdUfisPvERzXz/go-ipfs-cmds"
27 logging "gx/ipfs/QmRb5jh8z2E8hMGN2tkvs1yHynUanqnZ3UeKwgN1i9P1F8/go-log"
28 mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash"
@@ -73,7 +72,7 @@ var hashOption = cmdkit.StringOption("hash", "Hash function to use. Will set Cid
72
73 var formatError = errors.New("Format was set by multiple options. Only one format option is allowed")
74
76 -type StatOutput struct {
75 +type statOutput struct {
76 Hash string
77 Size uint64
78 CumulativeSize uint64
@@ -158,7 +157,7 @@ var filesStatCmd = &cmds.Command{
157 },
158 Encoders: cmds.EncoderMap{
159 cmds.Text: cmds.MakeEncoder(func(req *cmds.Request, w io.Writer, v interface{}) error {
161 - out, ok := v.(*StatOutput)
160 + out, ok := v.(*statOutput)
161 if !ok {
162 return e.TypeErr(out, v)
163 }
@@ -183,7 +182,7 @@ var filesStatCmd = &cmds.Command{
182 return nil
183 }),
184 },
186 - Type: StatOutput{},
185 + Type: statOutput{},
186 }
187
188 func moreThanOne(a, b, c bool) bool {
@@ -209,7 +208,7 @@ func statGetFormatOptions(req *cmds.Request) (string, error) {
208 }
209 }
210
212 -func statNode(nd ipld.Node) (*StatOutput, error) {
211 +func statNode(nd ipld.Node) (*statOutput, error) {
212 c := nd.Cid()
213
214 cumulsize, err := nd.Size()
@@ -234,7 +233,7 @@ func statNode(nd ipld.Node) (*StatOutput, error) {
233 return nil, fmt.Errorf("unrecognized node type: %s", d.GetType())
234 }
235
237 - return &StatOutput{
236 + return &statOutput{
237 Hash: c.String(),
238 Blocks: len(nd.Links()),
239 Size: d.GetFilesize(),
@@ -242,7 +241,7 @@ func statNode(nd ipld.Node) (*StatOutput, error) {
241 Type: ndtype,
242 }, nil
243 case *dag.RawNode:
245 - return &StatOutput{
244 + return &statOutput{
245 Hash: c.String(),
246 Blocks: 0,
247 Size: cumulsize,