Skip to content

Instantly share code, notes, and snippets.

@rydrman
Last active June 6, 2020 19:22
Show Gist options
  • Save rydrman/a020fc15f8b00ad3b01228ae1bfbc653 to your computer and use it in GitHub Desktop.
Save rydrman/a020fc15f8b00ad3b01228ae1bfbc653 to your computer and use it in GitHub Desktop.
Function example not existing as soon as possible
func getValue() int {
value := 0
if condition {
value = someBase()
if shouldMore {
value += more()
}
} else {
value = alternative()
}
return value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment