Method 'notEmpty' differs only by capitalization to function 'NotEmpty' in the same source file
286// notEmpty checks all fields are not zero, including pointer field references to other structs.
287// This method has the option to ignore fields without struct tags, which is helpful for checking
288// protobuf messages that have internal fields.
289func notEmpty(loggerFn assertionLoggerFn, obj interface{}, ignoreFieldsWithoutTags bool, fields []string, stackSize int, msg ...interface{}) {290 var v reflect.Value
291 if vo, ok := obj.(reflect.Value); ok {
292 v = reflect.Indirect(vo)
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
}