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

Commit

Permalink
Merge pull request #88 from coryschwartz/fix/incorrect-filesize-raw
Browse files Browse the repository at this point in the history
correct file size for raw node
  • Loading branch information
Stebalien authored Apr 21, 2021
2 parents 68c015a + 7e96bad commit a20f6cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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 a20f6cb

Please sign in to comment.