Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Created January 15, 2016 07:46
Show Gist options
  • Save hackintoshrao/2718167c1865150aa6af to your computer and use it in GitHub Desktop.
Save hackintoshrao/2718167c1865150aa6af to your computer and use it in GitHub Desktop.
non blocking single write into the channel
package main
import (
"fmt"
)
func main() {
//building a bridge for one person
//its important to specify the data type the bridge would carry
bridgeForOne := make(chan int, 1) // specifying the size of the bridge to be one
//lets onboard a integer onto the bridge
bridgeForOne <- 1
fmt.Println("Integer sent onto the bridge")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment