Method 'generateVoluntaryExits' differs only by capitalization to function 'GenerateVoluntaryExits' in the same source file
377 return exit, nil
378}
379
380func generateVoluntaryExits( 381 bState state.BeaconState,
382 privs []bls.SecretKey,
383 numExits uint64,
Method 'stateRootAtIndex' differs only by capitalization to method 'StateRootAtIndex' in the same source file
460// This assumes that a lock is already held on BeaconState.
461//
462// WARNING: This function does not work with the multi-value slice feature.
463func (b *BeaconState) stateRootAtIndex(idx uint64) ([32]byte, error) {464 if uint64(len(b.stateRoots)) <= idx {
465 return [32]byte{}, errors.Wrapf(consensus_types.ErrOutOfBounds, "state root index %d does not exist", idx)
466 }
Description
Methods or fields of struct that have names different only by capitalization could be confusing.
Bad practice
type SomeType struct {
// actual build system to be inferred, based on the `BuildSystem` passed by user
buildSystem string
// name of the build system to use
BuildSystem string
}
Recommended
type SomeType struct {
// actual build system to be inferred, based on the `BuildSystem` passed by user
internalBuildSystem string
// name of the build system to use
BuildSystem string
}