16. If Else
Control the flow
If Statement
flag := true
if flag {
fmt.Println("Flag is present")
}Stronger Semantics
count := 1
if "hello" {
fmt.Println("Invalid if")
}
if count {
fmt.Println("Invalid if")
}Multiple Branches
Ternary Operator
GitHub Code
Last updated