96 fmt.Printf("err: %+v\n", err)
97 return "", true
98 }
99 if len(ips) < 0 {100 fmt.Printf("no ip found for: %s\n", router)
101 return "", true
102 }
Return values of the len
and cap
builtins cannot be negative.
func foo(slice []int) {
if len(slice) < 0 {
fmt.Println("unreachable code")
}
}
func foo(slice []int) {
if len(slice) == 0 {
// Empty slice
}
}