提交 bc6974ab 编写于 作者: 麻凡_'s avatar 麻凡_

完成中阶

上级 a0c4c97f
# goroutine
# goroutine的创建
关于`goroutine`下面说法错误的是:
创建一个goroutine的关键字是:
## 答案
go
## 选项
### A
goto
### B
goroutine
### C
threading.Thread
\ No newline at end of file
{
"type": "code_options",
"author": "dengmengmian",
"source": "channel.md",
"notebook_enable": false
}
\ No newline at end of file
# channel
channel,下面语法错误的是
## 答案
`ch <-`
## 选项
### A
`<- ch`
### B
`ch := make(chan int)`
### C
`var ch chan int`
\ No newline at end of file
{
"type": "code_options",
"author": "dengmengmian",
"source": "mutex.md",
"notebook_enable": false
}
\ No newline at end of file
# mutex
关于同步锁,下面说法错误的是:
## 答案
Lock()操作需要保证有Unlock()或RUnlock()调用与之对应
## 选项
### A
RWMutex在写锁占用情况下,会阻止任何其他goroutine(无论读和写)进来,整个锁相当于由该goroutine独占
### B
RWMutex在读锁占用的情况下,会阻止写,但不阻止读
### C
当一个goroutine获得了Mutex后,其他goroutine就只能乖乖的等待,除非该goroutine释放这个Mutex
\ No newline at end of file
{
"type": "code_options",
"author": "dengmengmian",
"source": "generic.md",
"notebook_enable": false
}
\ No newline at end of file
# 泛型
1.18 版本关于泛型说法正确的是:
## 答案
匿名结构体不支持泛型
## 选项
### A
定义泛型类型的时候,基础类型支持类型形参
### B
匿名函数支持泛型
### C
Go的方法支持泛型
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册