Last active
January 15, 2016 07:41
-
-
Save hackintoshrao/bd10b70e968cf5a2231b to your computer and use it in GitHub Desktop.
First time use of channels
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
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