Skip to content

Instantly share code, notes, and snippets.

@amirkarimi
Created January 3, 2018 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amirkarimi/f073605fd27250abc6a5958eaf06ba62 to your computer and use it in GitHub Desktop.
Save amirkarimi/f073605fd27250abc6a5958eaf06ba62 to your computer and use it in GitHub Desktop.
def getUser(id: Int): Future[Option[User]] = ???
getUser(10).map {
case None => println(“User not found”)
case Some(user) => println(s”User: $user”)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment