Skip to content
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

EN-8515: Linter issues #2609

Merged
merged 7 commits into from Dec 19, 2020
Merged

EN-8515: Linter issues #2609

merged 7 commits into from Dec 19, 2020

Conversation

bogdan-rosianu
Copy link
Contributor

@bogdan-rosianu bogdan-rosianu commented Dec 18, 2020

Fixed relevant issues found by linters. (GoLand built-in linters + GolangCI)

@bogdan-rosianu bogdan-rosianu added the type:feature New feature or request label Dec 18, 2020
@bogdan-rosianu bogdan-rosianu self-assigned this Dec 18, 2020
@bogdan-rosianu bogdan-rosianu changed the title [WIP] EN-8515: Linter issues EN-8515: Linter issues Dec 18, 2020
@bogdan-rosianu bogdan-rosianu marked this pull request as ready for review December 18, 2020 14:32
facade/errors.go Outdated
@@ -23,5 +23,5 @@ var ErrNilPeerState = errors.New("nil peer state")
// ErrNilAccountState signals that a nil account state has been provided
var ErrNilAccountState = errors.New("nil account state")

// ErrNilTransactionSimulatorProcessor signals that a nil transaction simulator processor has been provided
// ErrErrNilTransactionSimulatorProcessor signals that a nil transaction simulator processor has been provided
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove double ErrErr from comment and error variable also

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

for key := range chunk.items {
keys = append(keys, key)
}
chunk.mutex.RUnlock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -148,11 +148,10 @@ func (m *ConcurrentMap) Keys() []string {

for _, chunk := range chunks {
chunk.mutex.RLock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can move this RLock in line 148 and RUnlock from line 154 to line 156, just to avoid multiple locks/unlocks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I can't because the mutex belongs to the chunk element from the range

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok

sasurobert
sasurobert previously approved these changes Dec 18, 2020
# Conflicts:
#	epochStart/metachain/epochStartData.go
Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System tests passed.

@LucianMincu LucianMincu merged commit a6ec73a into development Dec 19, 2020
@LucianMincu LucianMincu deleted the EN-8515-linter-checks-fixes branch December 29, 2020 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants