From e66bb9219833f2b63f5303409574855fe612fa0f Mon Sep 17 00:00:00 2001 From: Jeromy Date: Tue, 5 Sep 2017 21:20:49 -0700 Subject: [PATCH] address review nitpicks License: MIT Signed-off-by: Jeromy --- fuse/readonly/readonly_unix.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index 877de7abb..34932fc8e 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -182,16 +182,12 @@ func (s *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { if len(n) == 0 { n = lnk.Cid.String() } - // TODO: calling everything a DT_File here might cause issues. But it - // will be expensive to query each child. However most shells call an - // additional 'stat' on each item in a directory listing, its probably - // okay. nd, err := s.Ipfs.DAG.Get(ctx, lnk.Cid) if err != nil { log.Warning("error fetching directory child node: ", err) } - var t fuse.DirentType + t := fuse.DT_Unknown switch nd := nd.(type) { case *mdag.RawNode: t = fuse.DT_File @@ -213,8 +209,6 @@ func (s *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { log.Error("unrecognized protonode data type: ", data.GetType()) } } - default: - t = fuse.DT_Unknown } entries = append(entries, fuse.Dirent{Name: n, Type: t}) return nil