Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
a20f6cb5
Unverified
Commit
a20f6cb5
authored
3 years ago
by
Steven Allen
Committed by
GitHub
3 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #88 from coryschwartz/fix/incorrect-filesize-raw
correct file size for raw node
parents
68c015a6
7e96bad9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
unixfs.go
unixfs.go
+2
-2
No files found.
unixfs.go
View file @
a20f6cb5
...
...
@@ -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"
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment