Skip to content

Instantly share code, notes, and snippets.

@yumed15
Created November 22, 2023 12:21
Show Gist options
  • Save yumed15/2b9be6835531cf50c18d91c1606da56b to your computer and use it in GitHub Desktop.
Save yumed15/2b9be6835531cf50c18d91c1606da56b to your computer and use it in GitHub Desktop.
stringStream := make(chan string)
go func() {
stringStream <- "hello" // pass literal onto channel
}()
fmt.Println(<-stringStreams) // read the literal from channel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment