ICode9

精准搜索请尝试: 精确搜索
  • channel补充2022-09-02 22:35:25

    1. channel 1.1 channel的使用 例子:主go程发数据,子go程收数据。 package main import ( "fmt" "time" ) //主go程发数据,子go程收数据 func chanDemo() { c := make(chan int) go func() { for { fmt.Println(<-c)//不断的向信道获取数据,主go程

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有