2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import “fmt“ func main() { fmt.Pri

2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。

package main

import "fmt"

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

答案2022-07-04:

答案选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.

在这里插入图片描述

posted @ 2022-07-04 16:01  福大大架构师每日一题  阅读(9)  评论(0编辑  收藏  举报  来源