当前位置:网站首页>2022-06-28:以下golang代码输出什么?A:true;B:false;C:panic;D:编译失败。 package main import “fmt“ func main() {
2022-06-28:以下golang代码输出什么?A:true;B:false;C:panic;D:编译失败。 package main import “fmt“ func main() {
2022-06-28 21:57:00 【福大大架构师每日一题】
2022-06-28:以下golang代码输出什么?A:true;B:false;C:panic;D:编译失败。
package main
import "fmt"
func main() {
var p [100]int
var m interface{
} = [...]int{
99: 0}
fmt.Println(p == m)
}
答案2022-06-28:
答案选A。这道题以为选D,有点出乎意料。儿子属于老子,儿子们不属于老子们。只适合赋值,不适合比较。
A value x of non-interface type X and a value t of interface type T are comparable when values of type X are comparable and X implements T. They are equal if t’s dynamic type is identical to X and t’s dynamic value is equal to x. ——以上内容来自 https://go.dev/ref/spec#Operators

边栏推荐
- Multinomial distribution (a discrete distribution)
- 城市大脑知识图谱构建及应用研究
- 彪马携手10KTF Shop启动其迄今为止规模首屈一指的Web3合作项目
- Ctrip will push the "3+2" working mode: 3 days a week on duty and 2 days of free choice of office space. Do you envy it?
- C#/VB.NET 将PDF转为Excel
- 直播预告|SQL也能玩转工业级机器学习?MLOps meetup V3带你一探究竟!
- Golang JSON serializing and deserializing strings deserializing to map[string]interface{}
- There is no picture problem when using tcpdf to generate pdf
- In one sentence, I will tell you the meaning of select 1, 2 and 3 in SQL injection, and explain the meaning of each part of SQL injection in detail
- 宜明昂科在港交所递表:2021年亏损翻倍,过往融资额存在夸大情形
猜你喜欢

Use of axurer9 master

AI deep dive of Huawei cloud

Live broadcast preview | can SQL also play industrial machine learning? Mlops meetup V3 takes you to the bottom!

16 `bs object Node name Div. attribute contents ` children descendants get child nodes and descendants

什么是低代码开发?

C#/VB.NET 将PDF转为Excel

CVPR 2022|极具创意&美感的文字生成方法!支持任意输入

Multinomial distribution (a discrete distribution)

Use of dynamic panels

CORBA Architecture Guide (Common Object Request Broker Architecture)
随机推荐
Zadig 正式推出 VS Code 插件,本地开发更高效
华为云的AI深潜之旅
Quartz定时任务触发器启动时设置
Rosdep update using fishros to solve ros1/ros2 problems 2022
[linq]c list type grouping sum
Dart的类扩展、可选类型扩展
6年心得,从功能测试到测试开发,送给在测试路上一路走到黑的你
F1tenth gym of ROS 2 humble hawksbill
安全 创新 实践|海泰方圆受邀参加“数字时代的网信创新与价值共创”技术交流研讨会
终于有人把云原生架构讲明白了
Competition rules for the "network security" event of the secondary vocational group in the skills competition of Guangxi Vocational Colleges in 2022
彪马携手10KTF Shop启动其迄今为止规模首屈一指的Web3合作项目
SQLSERVER sys. Escape of parameter placeholders in messages
Sword finger offer:[day 1 stack and queue (simple)] --- > stack containing min function
宜明昂科在港交所递表:2021年亏损翻倍,过往融资额存在夸大情形
wrk压力测试工具介绍
6月底了,让我康康有多少准备跳槽的
Zero foundation self-study SQL course | complete collection of date functions in SQL
16 `bs object Node name Div. attribute contents ` children descendants get child nodes and descendants
别再问我,UI自动化测试怎么做了……