Skip to content

Instantly share code, notes, and snippets.

View rydrman's full-sized avatar

Ryan Bottriell rydrman

View GitHub Profile
@rydrman
rydrman / exit-first.go
Last active June 6, 2020 19:21
Function example exiting as soon as possible
func getValue() int {
if !condition {
return alternative()
}
value := someBase()
if !shouldMore {
return value
}
@rydrman
rydrman / no-exit-first.go
Last active June 6, 2020 19:22
Function example not existing as soon as possible
func getValue() int {
value := 0
if condition {
value = someBase()
if shouldMore {
value += more()
}

Keybase proof

I hereby claim:

  • I am rydrman on github.
  • I am rydrman (https://keybase.io/rydrman) on keybase.
  • I have a public key whose fingerprint is A16C 012A 2803 A56B AB03 01EB 90E9 41C0 CEB3 D853

To claim this, I am signing this object: