linter fixes (#5733)

* make .golangcy.yml work with Goland's Golint plugin

Explicitly disable all linters. Whitelist of enabled
plugins is already provided.

This would enable Goland users to user Golint plugin.

* fix deadcode warnings

* fix gocritic error

unslice: could simplify pkBytes[:] to pkBytes
This commit is contained in:
Alessio Treglia 2020-03-01 15:38:57 +00:00 committed by GitHub
parent 5f14dc2e42
commit 2ae25caa74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -3,6 +3,7 @@
# timeout: 5m
linters:
disable-all: true
enable:
- bodyclose
- deadcode
@ -30,8 +31,6 @@ linters:
- unconvert
- unused
- misspell
disable:
- errcheck
issues:
exclude-rules:

View File

@ -56,10 +56,6 @@ var (
pubkeys = []crypto.PubKey{
delPk1, delPk2, delPk3, valOpPk1, valOpPk2, valOpPk3,
}
emptyDelAddr sdk.AccAddress
emptyValAddr sdk.ValAddress
emptyPubkey crypto.PubKey
)
// TODO: remove dependency with staking
@ -76,7 +72,7 @@ func newPubKey(pk string) (res crypto.PubKey) {
panic(err)
}
var pkEd ed25519.PubKeyEd25519
copy(pkEd[:], pkBytes[:])
copy(pkEd[:], pkBytes)
return pkEd
}