superfly / flyctl

Empty string test can be improved CRT-A0004
Anti-pattern
Major
25 days ago4 years old
replace len(long) == 0 with long == ""
 78
 79	short := cmd.Short
 80	long := cmd.Long
 81	if len(long) == 0 { 82		long = short
 83	}
 84
replace len(line) == 0 with line == ""
561	for {
562		line, err := l.Readline()
563		if err == readline.ErrInterrupt {
564			if len(line) == 0 {565				break
566			} else {
567				continue