Created
December 30, 2020 12:52
-
-
Save danfoust/25d37d0fb8491609b30277c2b103e3a1 to your computer and use it in GitHub Desktop.
Async/Await in Golang
This file contains 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
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