码迷,mamicode.com
首页 > 其他好文 > 详细

channel _ golang

时间:2015-03-15 15:09:59      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

Channels are the pipes that connect concurrent goroutines. You can send values into channels from one goroutine andreceive those values into another goroutine

package main

import (
    "fmt"
)

func main() {

    messages := make(chan string)

    go func() { messages <- "ping" }()

    msg := <-messages
    fmt.Println(msg)
}
ping

总结 : 

  1 : .......

channel _ golang

标签:

原文地址:http://www.cnblogs.com/jackkiexu/p/4339773.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!