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

Commit a20f6cb

Browse files
authored
Merge pull request #88 from coryschwartz/fix/incorrect-filesize-raw
correct file size for raw node
2 parents 68c015a + 7e96bad commit a20f6cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: unixfs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ func size(pbdata *pb.Data) (uint64, error) {
159159
switch pbdata.GetType() {
160160
case pb.Data_Directory, pb.Data_HAMTShard:
161161
return 0, errors.New("can't get data size of directory")
162-
case pb.Data_File:
162+
case pb.Data_File, pb.Data_Raw:
163163
return pbdata.GetFilesize(), nil
164-
case pb.Data_Symlink, pb.Data_Raw:
164+
case pb.Data_Symlink:
165165
return uint64(len(pbdata.GetData())), nil
166166
default:
167167
return 0, errors.New("unrecognized node data type")

0 commit comments

Comments
 (0)