Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
5cee33eb
Unverified
Commit
5cee33eb
authored
Aug 24, 2021
by
baptiste-b-pegasys
Committed by
GitHub
Aug 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/fuzzers: fix go vet warning about ReadByte (#23380)
parent
85126c4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
trie-fuzzer.go
tests/fuzzers/trie/trie-fuzzer.go
+5
-5
No files found.
tests/fuzzers/trie/trie-fuzzer.go
View file @
5cee33eb
...
...
@@ -69,7 +69,7 @@ func newDataSource(input []byte) *dataSource {
input
,
bytes
.
NewReader
(
input
),
}
}
func
(
ds
*
dataSource
)
R
eadByte
()
byte
{
func
(
ds
*
dataSource
)
r
eadByte
()
byte
{
if
b
,
err
:=
ds
.
reader
.
ReadByte
();
err
!=
nil
{
return
0
}
else
{
...
...
@@ -89,22 +89,22 @@ func Generate(input []byte) randTest {
r
:=
newDataSource
(
input
)
genKey
:=
func
()
[]
byte
{
if
len
(
allKeys
)
<
2
||
r
.
R
eadByte
()
<
0x0f
{
if
len
(
allKeys
)
<
2
||
r
.
r
eadByte
()
<
0x0f
{
// new key
key
:=
make
([]
byte
,
r
.
R
eadByte
()
%
50
)
key
:=
make
([]
byte
,
r
.
r
eadByte
()
%
50
)
r
.
Read
(
key
)
allKeys
=
append
(
allKeys
,
key
)
return
key
}
// use existing key
return
allKeys
[
int
(
r
.
R
eadByte
())
%
len
(
allKeys
)]
return
allKeys
[
int
(
r
.
r
eadByte
())
%
len
(
allKeys
)]
}
var
steps
randTest
for
i
:=
0
;
!
r
.
Ended
();
i
++
{
step
:=
randTestStep
{
op
:
int
(
r
.
R
eadByte
())
%
opMax
}
step
:=
randTestStep
{
op
:
int
(
r
.
r
eadByte
())
%
opMax
}
switch
step
.
op
{
case
opUpdate
:
step
.
key
=
genKey
()
...
...
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