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

Posted 福大大架构师每日一题

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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.

以上是关于2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import “fmt“ func main() { fmt.Pri的主要内容,如果未能解决你的问题,请参考以下文章