Extend linter rules (#1300)

- dupword checks for duplicate words in the source code
- durationcheck checks for two durations multiplied together
- forbidigo forbids identifiers
- mirror reports wrong mirror patterns of bytes/strings usage
- misspell finds commonly misspelled English words in comments
- predeclared finds code that shadows one of Go's predeclared identifiers
- thelper detects Go test helpers without t.Helper() call and checks the consistency of test helpers
This commit is contained in:
Yury Gargay
2023-11-10 16:33:13 +01:00
committed by GitHub
parent a40261ff7e
commit 9e8725618e
37 changed files with 90 additions and 37 deletions

View File

@@ -355,7 +355,7 @@ func (am *MockAccountManager) UpdatePeerSSHKey(peerID string, sshKey string) err
if am.UpdatePeerSSHKeyFunc != nil {
return am.UpdatePeerSSHKeyFunc(peerID, sshKey)
}
return status.Errorf(codes.Unimplemented, "method UpdatePeerSSHKey is is not implemented")
return status.Errorf(codes.Unimplemented, "method UpdatePeerSSHKey is not implemented")
}
// UpdatePeer mocks UpdatePeerFunc function of the account manager
@@ -363,7 +363,7 @@ func (am *MockAccountManager) UpdatePeer(accountID, userID string, peer *server.
if am.UpdatePeerFunc != nil {
return am.UpdatePeerFunc(accountID, userID, peer)
}
return nil, status.Errorf(codes.Unimplemented, "method UpdatePeerFunc is is not implemented")
return nil, status.Errorf(codes.Unimplemented, "method UpdatePeerFunc is not implemented")
}
// CreateRoute mock implementation of CreateRoute from server.AccountManager interface