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-dms3-chunker
Commits
f4ac7aef
Commit
f4ac7aef
authored
Sep 07, 2018
by
Kejie Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return error if rabin min is less than 16
parent
2c504457
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
parse.go
parse.go
+5
-3
No files found.
parse.go
View file @
f4ac7aef
...
...
@@ -49,13 +49,15 @@ func parseRabinString(r io.Reader, chunker string) (Splitter, error) {
return
nil
,
errors
.
New
(
"first label must be min"
)
}
min
,
err
:=
strconv
.
Atoi
(
sub
[
len
(
sub
)
-
1
])
if
err
!=
nil
{
if
err
!=
nil
||
min
<
16
{
return
nil
,
err
}
if
min
<
16
{
return
nil
,
errors
.
New
(
"the rabin min should not less not 16"
)
}
sub
=
strings
.
Split
(
parts
[
2
],
":"
)
if
len
(
sub
)
>
1
&&
sub
[
0
]
!=
"avg"
{
log
.
Error
(
"sub == "
,
sub
)
//
log.Error("sub == ", sub)
return
nil
,
errors
.
New
(
"second label must be avg"
)
}
avg
,
err
:=
strconv
.
Atoi
(
sub
[
len
(
sub
)
-
1
])
...
...
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