mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
18 lines
197 B
Go
18 lines
197 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
queue := make(chan string, 2)
|
|
queue <- "one"
|
|
queue <- "two"
|
|
close(queue)
|
|
for elem := range queue {
|
|
fmt.Println(elem)
|
|
}
|
|
}
|
|
|
|
// Output:
|
|
// one
|
|
// two
|