Here is a piece of my code in Go
ips := strings.Split(IP, ",")
if len(ips) < 1 {
return fmt.Errorf("'%v' ip is wrong", ips)
}
I tested this and it seems that ips
variable can never be nil. For example, an empty string produces a slice of empty string (length 1).
Do you think I can remove the if
block?