Go code
ready := false
if ready {
fmt.Println("Go")
} else {
fmt.Println("Wait")
}Line-by-line explanation
- Ready is false.
- The first block is skipped.
- Else supplies the alternative.
- Wait is displayed.
Expected output
WaitThis is the expected result.
else if checks another condition only when the earlier one was false.