Omit unnecessary return statement
50}
51
52func (a *PendingAttestation) SetSignature(sig []byte) {
53 return54}
55
56func (a *PendingAttestation) GetSignature() []byte {
Omit unnecessary return statement
46}
47
48func (a *PendingAttestation) SetCommitteeBits(bits bitfield.Bitlist) {
49 return50}
51
52func (a *PendingAttestation) SetSignature(sig []byte) {
Omit unnecessary return statement
22}
23
24func (a *Attestation) SetCommitteeBits(bits bitfield.Bitlist) {
25 return26}
27
28func (a *Attestation) SetSignature(sig []byte) {
Description
Redundant statements, like a break at the end of a case block, can be removed for improving the code's readability.
Bad practice
loop:
for {
switch a {
case 1:
a++
println("one")
break // unnecessary
case 2:
println("two")
break loop
default:
println("default")
}
}
Recommended
loop:
for {
switch a {
case 1:
a++
println("one")
case 2:
println("two")
break loop
default:
println("default")
}
}