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
44b41641
Commit
44b41641
authored
Nov 25, 2019
by
Felix Lange
Committed by
Péter Szilágyi
Nov 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rlp: fix staticcheck warnings (#20368)
* rlp: fix staticcheck warnings * rlp: fix ExampleDecode test
parent
9ef90dbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
decode.go
rlp/decode.go
+6
-5
decode_test.go
rlp/decode_test.go
+4
-5
No files found.
rlp/decode.go
View file @
44b41641
...
...
@@ -29,12 +29,13 @@ import (
"sync"
)
var
(
// EOL is returned when the end of the current list
// has been reached during streaming.
EOL
=
errors
.
New
(
"rlp: end of list"
)
//lint:ignore ST1012 EOL is not an error.
// EOL is returned when the end of the current list
// has been reached during streaming.
var
EOL
=
errors
.
New
(
"rlp: end of list"
)
// Actual Errors
var
(
ErrExpectedString
=
errors
.
New
(
"rlp: expected String or Byte"
)
ErrExpectedList
=
errors
.
New
(
"rlp: expected List"
)
ErrCanonInt
=
errors
.
New
(
"rlp: non-canonical integer format"
)
...
...
rlp/decode_test.go
View file @
44b41641
...
...
@@ -354,7 +354,7 @@ type tailUint struct {
type
tailPrivateFields
struct
{
A
uint
Tail
[]
uint
`rlp:"tail"`
x
,
y
bool
x
,
y
bool
//lint:ignore U1000 unused fields required for testing purposes.
}
type
nilListUint
struct
{
...
...
@@ -806,9 +806,8 @@ func ExampleDecode() {
input
,
_
:=
hex
.
DecodeString
(
"C90A1486666F6F626172"
)
type
example
struct
{
A
,
B
uint
private
uint
// private fields are ignored
String
string
A
,
B
uint
String
string
}
var
s
example
...
...
@@ -819,7 +818,7 @@ func ExampleDecode() {
fmt
.
Printf
(
"Decoded value: %#v
\n
"
,
s
)
}
// Output:
// Decoded value: rlp.example{A:0xa, B:0x14,
private:0x0,
String:"foobar"}
// Decoded value: rlp.example{A:0xa, B:0x14, String:"foobar"}
}
func
ExampleDecode_structTagNil
()
{
...
...
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