-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix linter errors #1379
base: master
Are you sure you want to change the base?
Fix linter errors #1379
Conversation
suhasagg
commented
Jul 30, 2019
- I added unit tests for any code that added
- I updated the CHANGELOG.md
- All IP is original and not copied from another source
- I assign all copyright to Loom Network for the code in the pull request
auth/auth_test.go
Outdated
@@ -72,6 +72,7 @@ func TestSignatureTxMiddlewareMultipleTxSameBlock(t *testing.T) { | |||
//State is reset on every run | |||
ctx2 := context.WithValue(context.Background(), ContextKeyOrigin, origin) | |||
state2 := loomchain.NewStoreState(ctx2, store.NewMemStore(), abci.Header{Height: 27}, nil, nil) | |||
//nolint: ineffassign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't ignore these warnings, fix them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually assignment was assigning some variables which might be useful later on in tests but were not currently being used. I have fixed it as they can be assigned if needed.
eth/polls/polls_test.go
Outdated
@@ -80,6 +81,7 @@ func testLogPoll(t *testing.T, version handler.ReceiptHandlerVersion) { | |||
require.Equal(t, 0, len(logs.EthBlockLogs), "wrong number of logs returned") | |||
state60 := common.MockStateAt(state, uint64(60)) | |||
sub.Remove(id) | |||
//nolint: ineffassign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These too should be fixed, not ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually assignment was assigning some variables which might be useful later on in tests but were not currently being used. I have fixed it as they can be assigned if needed.
evm/loomethdb.go
Outdated
params LogParams | ||
batch batch | ||
params LogParams | ||
//nolint: unused, varcheck, deadcode, structcheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably fix all those
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
store/multi_writer_app_store_test.go
Outdated
@@ -146,6 +146,7 @@ func (m *MultiWriterAppStoreTestSuite) TestMultiWriterAppStoreSnapShotFlushInter | |||
require.Equal([]byte("test2"), snapshotv1.Get([]byte("test2"))) | |||
|
|||
// this flushes all data to disk | |||
//nolint: ineffassign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
addr3 = loom.MustParseAddress("default:0x5cecd1f7261e1f4c684e297be3edf03b825e01c5") | ||
addr4 = loom.MustParseAddress("default:0x5cecd1f7261e1f4c684e297be3edf03b825e01c7") | ||
addr5 = loom.MustParseAddress("default:0x5cecd1f7261e1f4c684e297be3edf03b825e01c9") | ||
//nolint: unused, varcheck, deadcode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are really unused then remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Solves ==> should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
Solves ==> should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
Solves ==> should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (gosimple)
|
Some discussion in this context - |
Use pointer to logger
Use pointer to logger
…into Fix_Linter_Errors