Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b57522c

Browse files
committedAug 7, 2015
mfs ls should get hashes
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
1 parent 08ebb4f commit b57522c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎mfs/dir.go

+12
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ type NodeListing struct {
175175
Name string
176176
Type int
177177
Size int64
178+
Hash string
178179
}
179180

180181
func (d *Directory) List() ([]NodeListing, error) {
@@ -199,6 +200,17 @@ func (d *Directory) List() ([]NodeListing, error) {
199200
}
200201
child.Size = size
201202
}
203+
nd, err := c.GetNode()
204+
if err != nil {
205+
return nil, err
206+
}
207+
208+
k, err := nd.Key()
209+
if err != nil {
210+
return nil, err
211+
}
212+
213+
child.Hash = k.B58String()
202214

203215
out = append(out, child)
204216
}

0 commit comments

Comments
 (0)
Please sign in to comment.