当前位置:网站首页>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 .
边栏推荐
- When facing complex problems, systematic thinking helps you understand the essence of the problem
- Kali modify the update source (it is not safe to update with this source)
- 3阶有向完全图的所有非同构的子图(不同钩子图个数)
- Array of arm disassembly
- Leetcode skimming -- guess the size of numbers II 375 medium
- Niuke-top101-bm38
- [manageengine]itsm application in retail industry
- Recommend a website that converts curl commands into PHP code & a website that initiates and executes curl requests online
- 牛客-TOP101-BM38
- Fusing and degrading Sentinel
猜你喜欢

Trusted and controllable way of Tencent cloud database

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

IEC61131 address representation

Interface testing tool restlet client

Miscellaneous notes -- a hodgepodge

作为测试,如何理解线程同步异步

Focus on data | Haitai Fangyuan directly hits the construction idea of data security governance in the securities industry

Cesium polygon gradient texture (canvas)

Programmer's Guide to health quenching 5: introduction to sports Basics

Research: more than 70% of doctors are still prescribing unsafe antibiotic drugs
随机推荐
数据库sql语句练习题「建议收藏」
Airtest解决“自动装包”过程中需要输入密码的问题(同适用于随机弹框处理)
Based on pexels image material API, sort out the material resource library
seven point two three
Miscellaneous notes -- a hodgepodge
Hello, I'd like to ask questions about C and database operation.
sqlx库使用
Temperature and humidity environment monitoring system based on stm32
Canvas fill gradient
In depth understanding of seven specific ways to enhance code scalability
Use Navicat to connect to MySQL database through SSH channel (pro test is feasible)
全志芯片bsp命名规则
Vivo official website app full model UI adaptation scheme
476-82(322、64、2、46、62、114)
[FAQ] access the HMS core push service, and the server sends messages. Cause analysis and solutions of common error codes
浅谈web性能优化(一)
Huawei occupies half of the folding mobile phone market, proving its irreplaceable position in the high-end market
Beisen Holdings' IPO: a total loss of 4.115 billion yuan in three years, and a total of 2.84 billion yuan in the previous nine rounds of financing
An interview question about concurrent reading and writing of map in golang
CTS test steps (Casio cts200 test)