Method 'stateRootAtIndex' differs only by capitalization to method 'StateRootAtIndex' in the same source file
477// This assumes that a lock is already held on BeaconState.
478//
479// WARNING: This function does not work with the multi-value slice feature.
480func (b *BeaconState) stateRootAtIndex(idx uint64) ([32]byte, error) {481 if uint64(len(b.stateRoots)) <= idx {
482 return [32]byte{}, errors.Wrapf(consensus_types.ErrOutOfBounds, "state root index %d does not exist", idx)
483 }
Method 'isEligibleForActivation' differs only by capitalization to function 'IsEligibleForActivation' in the same source file
463}
464
465// isEligibleForActivation carries out the logic for IsEligibleForActivation*
466func isEligibleForActivation(activationEligibilityEpoch, activationEpoch, finalizedEpoch primitives.Epoch) bool {467 return activationEligibilityEpoch <= finalizedEpoch &&
468 activationEpoch == params.BeaconConfig().FarFutureEpoch
469}
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
}