Skip to content

Instantly share code, notes, and snippets.

@danfoust
Created December 30, 2020 12:52
Show Gist options
  • Save danfoust/25d37d0fb8491609b30277c2b103e3a1 to your computer and use it in GitHub Desktop.
Save danfoust/25d37d0fb8491609b30277c2b103e3a1 to your computer and use it in GitHub Desktop.
Async/Await in Golang
c := make(chan User, 1)
go func() { c <- getUser() }() // async
user := <-c // await
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment