mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 13:55:17 +00:00
add staticcheck linting (#3828)
cleanup to add linter
grpc change:
https://godoc.org/google.golang.org/grpc#WithContextDialer
https://godoc.org/google.golang.org/grpc#WithDialer
grpc/grpc-go#2627
prometheous change:
due to UninstrumentedHandler, being deprecated in the future
empty branch = empty if or else statement
didn't delete them entirely but commented
couldn't find a reason to have them
could not replicate the issue #3406
but if want to keep it commented then we should comment out the if statement as well
This commit is contained in:
@@ -61,9 +61,10 @@ func (trs *TaskResultSet) Reap() *TaskResultSet {
|
||||
TaskResult: result,
|
||||
OK: true,
|
||||
}
|
||||
} else {
|
||||
// We already wrote it.
|
||||
}
|
||||
// else {
|
||||
// We already wrote it.
|
||||
// }
|
||||
default:
|
||||
// Do nothing.
|
||||
}
|
||||
@@ -83,9 +84,10 @@ func (trs *TaskResultSet) Wait() *TaskResultSet {
|
||||
TaskResult: result,
|
||||
OK: true,
|
||||
}
|
||||
} else {
|
||||
// We already wrote it.
|
||||
}
|
||||
// else {
|
||||
// We already wrote it.
|
||||
// }
|
||||
}
|
||||
return trs
|
||||
}
|
||||
|
||||
@@ -40,9 +40,10 @@ func TestParallel(t *testing.T) {
|
||||
} else if !assert.Equal(t, -1*i, taskResult.Value.(int)) {
|
||||
assert.Fail(t, "Task should have returned %v but got %v", -1*i, taskResult.Value.(int))
|
||||
failedTasks++
|
||||
} else {
|
||||
// Good!
|
||||
}
|
||||
// else {
|
||||
// Good!
|
||||
// }
|
||||
}
|
||||
assert.Equal(t, failedTasks, 0, "No task should have failed")
|
||||
assert.Nil(t, trs.FirstError(), "There should be no errors")
|
||||
|
||||
@@ -273,11 +273,11 @@ func TestResubscribe(t *testing.T) {
|
||||
defer s.Stop()
|
||||
|
||||
ctx := context.Background()
|
||||
subscription, err := s.Subscribe(ctx, clientID, query.Empty{})
|
||||
_, err := s.Subscribe(ctx, clientID, query.Empty{})
|
||||
require.NoError(t, err)
|
||||
err = s.Unsubscribe(ctx, clientID, query.Empty{})
|
||||
require.NoError(t, err)
|
||||
subscription, err = s.Subscribe(ctx, clientID, query.Empty{})
|
||||
subscription, err := s.Subscribe(ctx, clientID, query.Empty{})
|
||||
require.NoError(t, err)
|
||||
|
||||
err = s.Publish(ctx, "Cable")
|
||||
|
||||
Reference in New Issue
Block a user