当前位置:网站首页>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

边栏推荐
- Move the mouse out of the selected area style cancel
- 杆会睡不着觉
- What is low code development?
- 解读 | 数据分析的发展和演变都经过哪几个阶段?
- 直播预告|SQL也能玩转工业级机器学习?MLOps meetup V3带你一探究竟!
- docker下载Mysql镜像创建数据库链接时候发生密码错误问题
- [width first search note] BFS output shortest path
- 6年心得,从功能测试到测试开发,送给在测试路上一路走到黑的你
- 加刚干的前提
- Multinomial distribution (a discrete distribution)
猜你喜欢

F1tenth gym of ROS 2 humble hawksbill

Architecture design of e-commerce secsha system

场景化接口开发利器,金蝶云苍穹新版OpenAPI引擎来了!

What is low code development?

初识阿里云(云计算)—发展历程和技术架构、地域和可用区!

项目管理到底管的是什么?

How to make beautiful pictures

Multinomial distribution (a discrete distribution)

華為雲的AI深潜之旅

Get to know Alibaba cloud (Cloud Computing) - development history, technical architecture, region and availability zone!
随机推荐
什么是低代码开发?
Nc1033 palindrome substring of small a (ring, interval DP)
运维体系建设思考 - 稳定性篇
【selenium自动化过程中的api抓包】browsermobproxy的安装和配置
职业问诊 | 面试中被问到意向薪资时,该怎么回答?
Rosdep update using fishros to solve ros1/ros2 problems 2022
E-commerce is popular, how to improve the store conversion rate?
JS array common methods
在亿学学堂开通证券账户是安全可靠的吗?
PAT 1021. Traversal of the deep root (25 points) graph, DFS, calculating the number of connected components
电商秒杀系统架构设计
Axure custom components
华为云的AI深潜之旅
華為雲的AI深潜之旅
TCP三次握手四次挥手
Zadig 构建究竟何强大?一起来实践
小样本利器2.文本对抗+半监督 FGSM & VAT & FGM代码实现
Icon fill color and background color change together
科技巨头成立元宇宙标准论坛,走向开放还是建立围城?
【HackTheBox】dancing(SMB)