3 ms·
There is a mistake in the presentation. This compiles, even without a return after the if/else block. func comp(a, b int) int { if a < b { return -
by xyproto 7y ago
There is a mistake in the presentation. This compiles, even without a return after the if/else block.
func comp(a, b int) int {
if a < b {
return -1
} else if a > b {
return 1
} else {
return 0
}
}