Skip to content

Commit

Permalink
Merge pull request ipfs/go-unixfs#88 from coryschwartz/fix/incorrect-…
Browse files Browse the repository at this point in the history
…filesize-raw

correct file size for raw node

This commit was moved from ipfs/go-unixfs@a20f6cb
  • Loading branch information
Stebalien authored Apr 21, 2021
2 parents 8d85245 + e633f8d commit 1cc69fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unixfs/ipld-merkledag/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ func size(pbdata *pb.Data) (uint64, error) {
switch pbdata.GetType() {
case pb.Data_Directory, pb.Data_HAMTShard:
return 0, errors.New("can't get data size of directory")
case pb.Data_File:
case pb.Data_File, pb.Data_Raw:
return pbdata.GetFilesize(), nil
case pb.Data_Symlink, pb.Data_Raw:
case pb.Data_Symlink:
return uint64(len(pbdata.GetData())), nil
default:
return 0, errors.New("unrecognized node data type")
Expand Down

0 comments on commit 1cc69fd

Please sign in to comment.