mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
21 lines
229 B
Go
21 lines
229 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func someChan() <-chan struct{} {
|
|
c := make(chan struct{}, 1)
|
|
c <- struct{}{}
|
|
return c
|
|
}
|
|
|
|
func main() {
|
|
for _ = range someChan() {
|
|
fmt.Println("success")
|
|
return
|
|
}
|
|
}
|
|
|
|
// Output:
|
|
// success |