Created
November 2, 2022 18:19
-
-
Save Sirpyerre/e9f27615486ac9a732841038a3ef64c9 to your computer and use it in GitHub Desktop.
Go if/else
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
elegible := true | |
hasCredit := false | |
message := "" | |
if elegible { | |
if hasCredit { | |
message = "Can use the credit" | |
} else { | |
message = "Not enough credit" | |
} | |
} else { | |
message = "Not elegible to buy" | |
} | |
fmt.Println(message) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment