all: simplify nested complexity and if blocks ending with a return statement (#21854)

Changes:

    Simplify nested complexity
    If an if blocks ends with a return statement then remove the else nesting.

Most of the changes has also been reported in golint https://goreportcard.com/report/github.com/ethereum/go-ethereum#golint
This commit is contained in:
Alex Prut
2020-11-25 09:24:50 +01:00
committed by GitHub
parent 29efe1fc7e
commit c92faee66e
19 changed files with 58 additions and 85 deletions

View File

@ -112,9 +112,8 @@ var (
}
enc, err := rlp.EncodeToBytes(&ne)
return enc, err
} else {
return nil, errors.New("invalid field type")
}
return nil, errors.New("invalid field type")
},
func(enc []byte) (interface{}, error) {
var ne nodeHistoryEnc