Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

fix(type): issue #13 #14

Merged
merged 1 commit into from
Sep 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
dag "github.com/ipfs/go-merkledag"
ft "github.com/ipfs/go-unixfs"
uio "github.com/ipfs/go-unixfs/io"
ufspb "github.com/ipfs/go-unixfs/pb"

cid "github.com/ipfs/go-cid"
ipld "github.com/ipfs/go-ipld-format"
Expand Down Expand Up @@ -158,22 +157,22 @@ func (d *Directory) cacheNode(name string, nd ipld.Node) (FSNode, error) {
}

switch fsn.Type() {
case ufspb.Data_Directory, ufspb.Data_HAMTShard:
case ft.TDirectory, ft.THAMTShard:
ndir, err := NewDirectory(d.ctx, name, nd, d, d.dserv)
if err != nil {
return nil, err
}

d.childDirs[name] = ndir
return ndir, nil
case ufspb.Data_File, ufspb.Data_Raw, ufspb.Data_Symlink:
case ft.TFile, ft.TRaw, ft.TSymlink:
nfi, err := NewFile(name, nd, d, d.dserv)
if err != nil {
return nil, err
}
d.files[name] = nfi
return nfi, nil
case ufspb.Data_Metadata:
case ft.TMetadata:
return nil, ErrNotYetImplemented
default:
return nil, ErrInvalidChild
Expand Down