当前位置:网站首页>2022-07-06: will the following go language codes be panic? A: Meeting; B: No. package main import “C“ func main() { var ch chan struct

2022-07-06: will the following go language codes be panic? A: Meeting; B: No. package main import “C“ func main() { var ch chan struct

2022-07-07 07:39:00 Fuda frame constructor daily question

2022-07-06: following go Whether the language code will panic?A: Meeting ;B: Can't .

package main

import "C"

func main() {
    
    var ch chan struct{
    }
    <-ch
}

answer 2022-07-06:

Answer selection B. If you put import “C” Comment out , Meeting panic. as a result of cgo Will invalidate the deadlock check .

 Insert picture description here
 Insert picture description here

原网站

版权声明
本文为[Fuda frame constructor daily question]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070358304025.html