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

边栏推荐
- [golang] leetcode intermediate subset & Word Search
- Survival of beaver: post-90s female doctors and AI developers
- Un voyage profond d'IA dans Huawei Cloud
- docker下载Mysql镜像创建数据库链接时候发生密码错误问题
- Description détaillée du schéma technique du sous - environnement syntonique auto - test de Zadig pour les développeurs
- LxC shared USB device
- 直播预告|SQL也能玩转工业级机器学习?MLOps meetup V3带你一探究竟!
- 5毛VS600亿,食品安全问题是卫龙上市最大的拦路虎?
- How to use the style label of jade template- How to use the style tag with jade templates?
- MSCI 2022年市场分类评估
猜你喜欢

How to make beautiful pictures

Survival of beaver: post-90s female doctors and AI developers

什么是低代码开发?

BOE was brilliant for the Winter Olympics, but revealed another Chinese technology enterprise dominating the world

E-commerce is popular, how to improve the store conversion rate?

Use of dynamic panels

Zadig 正式推出 VS Code 插件,本地开发更高效

After reading the list of global patent and chip buyers, I understand that high innovation can lead to high profits

别再问我,UI自动化测试怎么做了……

Zadig + SonarQube,为开发过程安全保驾
随机推荐
Progress in visual weakly supervised learning
10、标准I/O输入输出重定向及管道
[golang] leetcode intermediate subset & Word Search
现在还能入“坑”数据分析吗?看看2022年数据分析热门岗位!
6年心得,从功能测试到测试开发,送给在测试路上一路走到黑的你
PE file-
Pat 1024 palindromic number (25 points) sum of large integers
Lua source code analysis: 1 Lua variable type mutability is implemented in C code.
硬件开发笔记(七): 硬件开发基本流程,制作一个USB转RS232的模块(六):创建0603封装并关联原理图元器件
IDC:阿里云获2021中国数据治理平台市场份额第一
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
[software test] 2022 national unified college enrollment examination
Deploy grafana to realize graphical monitoring
Multinomial distribution (a discrete distribution)
ROS 2 Humble Hawksbill 之 f1tenth gym
Competition rules for the "network security" event of the secondary vocational group in the skills competition of Guangxi Vocational Colleges in 2022
Gross vs60 billion. Is food safety the biggest obstacle to Weilong's listing?
Binomial distribution (a discrete distribution)
[webapi] return dynamic list dynamic
Zadig 面向開發者的自測聯調子環境技術方案詳解