Redundant else-blocks can be eliminated RVV-A0009
Anti-pattern
Major
6 months ago3 years old
if block ends with call to os.Exit function, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
 68		cmd.Parse(os.Args[3:])
 69		cmd.Run()
 70		os.Exit(0)
 71	} else { 72		if name == "" {
 73			printHelp()
 74		} else {
if block ends with a continue statement, so drop this else and outdent its block
 85		if isPrefix {
 86			prefix += line
 87			continue
 88		} else { 89			isLongLine = true
 90		}
 91
if block ends with a continue statement, so drop this else and outdent its block
 84			if err == nil {
 85				fValue.Set(reflect.ValueOf(dftValue))
 86				continue
 87			} else { 88				return err
 89			}
 90		}
if block ends with a break statement, so drop this else and outdent its block
 87			if mi.Fields.Pk != nil {
 88				err = fmt.Errorf("one model must have one pk field only")
 89				break
 90			} else { 91				mi.Fields.Pk = fi
 92			}
 93		}
if block ends with a goto statement, so drop this else and outdent its block
285		if field.Kind() != reflect.Slice {
286			err = fmt.Errorf("rel/reverse:many field must be slice")
287			goto end
288		} else {289			if field.Type().Elem().Kind() != reflect.Ptr {
290				err = fmt.Errorf("rel/reverse:many slice must be []*%s", field.Type().Elem().Name())
291				goto end