parameter 'ctx' seems to be unused, consider removing or renaming it as _
38// data=attestation.data,
39// signature=attestation.signature,
40// )
41func ConvertToIndexed(ctx context.Context, attestation interfaces.Attestation, committees [][]primitives.ValidatorIndex) (*ethpb.IndexedAttestation, error) { 42 attIndices, err := AttestingIndices(attestation, committees)
43 if err != nil {
44 return nil, err
parameter 'sig' seems to be unused, consider removing or renaming it as _
49 return
50}
51
52func (a *PendingAttestation) SetSignature(sig []byte) {53 return
54}
55
parameter 'bits' seems to be unused, consider removing or renaming it as _
45 a.Data = data
46}
47
48func (a *PendingAttestation) SetCommitteeBits(bits bitfield.Bitlist) {49 return
50}
51
parameter 'bits' seems to be unused, consider removing or renaming it as _
21 a.Data = data
22}
23
24func (a *Attestation) SetCommitteeBits(bits bitfield.Bitlist) {25 return
26}
27
parameter 'root' seems to be unused, consider removing or renaming it as _
260 panic("implement me")
261}
262
263func (b *BeaconBlock) SetStateRoot(root []byte) {264 panic("implement me")
265}
266
Description
Unused parameters in functions or methods should be replaced with _
(underscore) or removed.
Functions or methods with unused parameters can be a symptom of unfinished
refactoring or a bug. If an unused parameter is present, it should be named _
(underscore) to avoid raising this issue and better readability.
Bad practice
func abc(unused string) {
fmt.Println("Not using any passed params.")
}
Recommended
func abc(_ string) {
fmt.Println("Not using any passed params.")
}
func abc() {
fmt.Println("Not using any passed params.")
}