mirror of
https://github.com/SourceFellows/gobuch.git
synced 2025-09-19 02:24:54 +02:00
initial import
This commit is contained in:
20
hello-go-channel/main.go
Normal file
20
hello-go-channel/main.go
Normal file
@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func sayHello(c chan string) {
|
||||
fmt.Println("vor")
|
||||
c <- "Hello World"
|
||||
fmt.Println("nach")
|
||||
}
|
||||
|
||||
func main() {
|
||||
c := make(chan string)
|
||||
go sayHello(c)
|
||||
fmt.Println("vor2")
|
||||
text := <-c
|
||||
fmt.Println("nach2")
|
||||
fmt.Println(text)
|
||||
}
|
Reference in New Issue
Block a user