Add errcheck and gosimple linters (#9729)

* Add errcheck linter

* Check unchecked error

* Add gosimple linter

* Remove type assertion to same type

* Omit nil check

len() for nil slices is defined as zero

* Revert "Remove type assertion to same type"

This reverts commit af69ca1ac8.

* Revert "Revert "Remove type assertion to same type""

This reverts commit 5fe8931504.

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
Håvard Anda Estensen
2021-10-23 00:40:03 +02:00
committed by GitHub
parent 5b3375638a
commit 7f3ec4221f
5 changed files with 6 additions and 7 deletions

View File

@@ -57,7 +57,7 @@ func AggregatePublicKeys(pubs [][]byte) (common.PublicKey, error) {
if features.Get().SkipBLSVerify {
return &PublicKey{}, nil
}
if pubs == nil || len(pubs) == 0 {
if len(pubs) == 0 {
return nil, errors.New("nil or empty public keys")
}
agg := new(blstAggregatePublicKey)