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
283f5df3
Commit
283f5df3
authored
6 years ago
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error style
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
cb89bd3d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
io/pbdagreader.go
io/pbdagreader.go
+1
-1
test/utils.go
test/utils.go
+2
-2
unixfs.go
unixfs.go
+2
-2
No files found.
io/pbdagreader.go
View file @
283f5df3
...
...
@@ -238,7 +238,7 @@ func (dr *PBDagReader) Seek(offset int64, whence int) (int64, error) {
switch
whence
{
case
io
.
SeekStart
:
if
offset
<
0
{
return
-
1
,
errors
.
New
(
"
I
nvalid offset"
)
return
-
1
,
errors
.
New
(
"
i
nvalid offset"
)
}
if
offset
==
dr
.
offset
{
return
offset
,
nil
...
...
This diff is collapsed.
Click to expand it.
test/utils.go
View file @
283f5df3
...
...
@@ -95,11 +95,11 @@ func GetRandomNode(t testing.TB, dserv ipld.DAGService, size int64, opts NodeOpt
// ArrComp checks if two byte slices are the same.
func
ArrComp
(
a
,
b
[]
byte
)
error
{
if
len
(
a
)
!=
len
(
b
)
{
return
fmt
.
Errorf
(
"
A
rrays differ in length. %d != %d"
,
len
(
a
),
len
(
b
))
return
fmt
.
Errorf
(
"
a
rrays differ in length. %d != %d"
,
len
(
a
),
len
(
b
))
}
for
i
,
v
:=
range
a
{
if
v
!=
b
[
i
]
{
return
fmt
.
Errorf
(
"
A
rrays differ at index: %d"
,
i
)
return
fmt
.
Errorf
(
"
a
rrays differ at index: %d"
,
i
)
}
}
return
nil
...
...
This diff is collapsed.
Click to expand it.
unixfs.go
View file @
283f5df3
...
...
@@ -129,13 +129,13 @@ func DataSize(data []byte) (uint64, error) {
switch
pbdata
.
GetType
()
{
case
pb
.
Data_Directory
:
return
0
,
errors
.
New
(
"
C
ant get data size of directory"
)
return
0
,
errors
.
New
(
"
c
an
'
t get data size of directory"
)
case
pb
.
Data_File
:
return
pbdata
.
GetFilesize
(),
nil
case
pb
.
Data_Raw
:
return
uint64
(
len
(
pbdata
.
GetData
())),
nil
default
:
return
0
,
errors
.
New
(
"
U
nrecognized node data type"
)
return
0
,
errors
.
New
(
"
u
nrecognized 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