Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Last active January 15, 2016 07:41
Show Gist options
  • Save hackintoshrao/bd10b70e968cf5a2231b to your computer and use it in GitHub Desktop.
Save hackintoshrao/bd10b70e968cf5a2231b to your computer and use it in GitHub Desktop.
First time use of channels
package main
import (
"fmt"
)
func main() {
//building a bridge
//its important to specify the data type the bridge would carry
bridgeForOne := make(chan int)
//lets onboard a integer onto the bridge
//this is how you onboard a person "bridge <- 1" and this is how you get the person off the bridge "<-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