当前位置:网站首页>2022-07-18: what is the output of the following go language code? A:Groutine; B:Main; C:Goroutine; D:GoroutineMain。 package m
2022-07-18: what is the output of the following go language code? A:Groutine; B:Main; C:Goroutine; D:GoroutineMain。 package m
2022-07-25 21:24:00 【Fuda frame constructor daily question】
2022-07-18: following go What language code outputs ?A:Groutine;B:Main;C:Goroutine;D:GoroutineMain.
package main
import (
"fmt"
"time"
)
func main() {
ch := make(chan bool)
go func() {
<-ch
fmt.Print("Goroutine")
}()
time.Sleep(2 * time.Second)
close(ch)
time.Sleep(3 * time.Second)
fmt.Print("Main")
}answer 2022-07-18:
Answer selection D. close channel after ,<-ch Will return to .
边栏推荐
- "Shallow in and shallow out" MySQL and InnoDB [it is recommended to collect and share]
- Leetcode-155: minimum stack
- How to solve the problem of high concurrency and large traffic with PHP
- Autojs learning - realize 3D perspective
- cts测试步骤(卡西欧cts200测试)
- [online tutorial] iptables official tutorial -- learning notes 2
- Canvas fill gradient
- MySQL master-slave replication data synchronization, summary of common problems
- Apache Shenyu admin authentication bypass vulnerability (cve-2021-37580) analysis and protection measures
- LeetCode刷题——猜数字大小II#375#Medium
猜你喜欢

零基础学习CANoe Panel(17)—— Panel CAPL Function

Canvas 填充渐变

Unity vs -- the default debugging in VS is to start rather than attach to unity debugging

How to choose sentinel vs. hystrix current limiting?
![[online tutorial] iptables official tutorial -- learning notes 2](/img/7d/5f8328d1b4c8878f17c95d2658d2d6.jpg)
[online tutorial] iptables official tutorial -- learning notes 2

Pycharm跑程序时自动进入测试模式

Add startup software items when the win system starts up
![[ManageEngine] value brought by Siem to enterprises](/img/1e/56d64d193e0428523418bef5e98866.png)
[ManageEngine] value brought by Siem to enterprises

JMeter distributed pressure measurement

Programmer's Guide to health quenching 5: introduction to sports Basics
随机推荐
Basic knowledge of Marine Geology
Use of C log4net: add file name and line number to the output log content; Repackaged class output file name and line number
MySQL master-slave replication data synchronization, summary of common problems
数据库sql语句练习题「建议收藏」
Reading the pointpillar code of openpcdet -- Part 3: Calculation of loss function
When MySQL resets the root password and modifies the password, an error occurs. The password field does not exist
How to store pictures in the database "suggested collection"
浅谈web性能优化(一)
In June 2021, the interview suffered a Waterloo. Is it so convoluted now
Experience sharing of system architecture designers preparing for the exam: from point to surface
租房二三事
A detailed explanation of SCP command
Golang language quickly get started to comprehensive practical notes (go language, beego framework, high concurrency chat room, crawler)
Apple estimates that iPhone will give up the Chinese market, and the Chinese industrial chain needs to consider living a hard life
I live far away. Is there a good way to open an account? Is it safe to open a stock account by mobile phone?
Qixin Jushi cloud spectrum new chapter | Haitai Fangyuan and Sichuan Unicom reach ecological strategic cooperation
[depth] the new LAAS agreement elephant: the key to revitalizing the development of the defi track
Recommend a website that converts curl commands into PHP code & a website that initiates and executes curl requests online
cv图像翻转,EmguCV图像旋转「建议收藏」
MPI learning notes (II): two implementation methods of matrix multiplication