当前位置:网站首页>2022-07-04: what is the output of the following go language code? A:true; B:false; C: Compilation error. package main import 'fmt' func

2022-07-04: what is the output of the following go language code? A:true; B:false; C: Compilation error. package main import 'fmt' func

2022-07-04 19:01:00 Fuda frame constructor daily question

2022-07-04: following go What language code outputs ?A:true;B:false;C: Compile error .

package main

import "fmt"

func main() {
    fmt.Println(func() {} == func() {})
}

answer 2022-07-04:

Answer selection C.Slice, map, and function values are not comparable. However, as a special case, a slice, map, or function value may be compared to the predeclared identifier nil.

Insert picture description here
原网站

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