Skip to content

Instantly share code, notes, and snippets.

@deckarep
Last active December 21, 2016 04:23
Show Gist options
  • Save deckarep/43747ba522b0971bc153bb701c70e7a5 to your computer and use it in GitHub Desktop.
Save deckarep/43747ba522b0971bc153bb701c70e7a5 to your computer and use it in GitHub Desktop.
Breaking Go's mantra
func adder(amount int) {
for item := range adderChannel {
item.number += amount
doublerChannel <- item
fmt.Println(item.number) // <-- uh oh!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment