当前位置:网站首页>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 .
边栏推荐
- sqlx库使用
- 3阶有向完全图的所有非同构的子图(不同钩子图个数)
- mysql导入数据时已改成csv utf8文件且文件名为英文,为什么还是导入失败
- The inexplicability of Intel disassembly
- Sum of two numbers and three numbers
- Per capita Swiss number series, Swiss number 4 generation JS reverse analysis
- 测试用例和缺陷报告模板
- 使用oap切面导致controller被重复调用
- Cesium polygon gradient texture (canvas)
- ES6---4个强大运算符(??、??=、?.、?:)
猜你喜欢
![[FAQ] access the HMS core push service, and the server sends messages. Cause analysis and solutions of common error codes](/img/65/4dd3a521946e753c79d3db1fa0a4f4.png)
[FAQ] access the HMS core push service, and the server sends messages. Cause analysis and solutions of common error codes

DDD go practice

接口测试工具 restlet client

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

字节一面:TCP 和 UDP 可以使用同一个端口吗?

My heart's broken! After being cheated by 30000, a 16-year-old girl was unconvinced and cheated by 50000

Miscellaneous notes -- a hodgepodge

The onnx model is exported as a TRT model

Add startup software items when the win system starts up

Per capita Swiss number series, Swiss number 4 generation JS reverse analysis
随机推荐
GDB locates the main address of the program after strip
What's special about Huawei's innovative solutions to consolidate the foundation of ERP for small and medium-sized enterprises?
【FiddlerTX插件】使用Fiddler抓包腾讯课堂视频下载(抓不到包解决方案)
Miscellaneous notes -- a hodgepodge
Leetcode skimming -- guess the size of numbers II 375 medium
Sentinel vs Hystrix 限流对比,到底怎么选?
Achieve accurate positioning based on Tencent map, and realize the attendance punch function of wechat applet
NPM module removal_ [solved] after NPM uninstalls the module, the module is not removed from package.json [easy to understand]
Autojs learning - realize 3D perspective
An interview question about interface and implementation in golang
Debugged PEB (beingdebugged, ntglobalflag)
How to choose sentinel vs. hystrix current limiting?
SSH private key realizes login to remote target server
ag 搜索工具参数详解
The role of the resize function is "suggestions collection"
MySQL master-slave replication data synchronization, summary of common problems
Cesium polygon gradient texture (canvas)
The inexplicability of Intel disassembly
Leetcode-155: minimum stack
Introduction to MySQL engine and InnoDB logical storage structure