赞
踩
range-over-channels.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)
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。