当前位置:网站首页>2022-06-22:golang选择题,以下golang代码输出什么?A:3;B:1;C:4;D:编译失败。
2022-06-22:golang选择题,以下golang代码输出什么?A:3;B:1;C:4;D:编译失败。
2022-06-23 08:43:00 【福大大架构师每日一题】
2022-06-22:golang选择题,以下golang代码输出什么?A:3;B:1;C:4;D:编译失败。
package main
import (
"fmt"
)
func main() {
var nums1 []interface{}
nums2 := []int{1, 3, 4}
nums3 := append(nums1, nums2...)
fmt.Println(len(nums3))
}答案2022-06-22:
答案选D。编译报错cannot use nums2 (type []int) as type []interface {} in append。int属于interface{},[]int不属于[]interface{}。儿子属于老子,儿子们不属于老子们。
边栏推荐
- The fourth online workshop review
- Open source technology exchange batch stream integrated data synchronization engine Chunjun data restore DDL function module analysis
- Object. Defineproperty() and data broker
- Only 187 bytes of desktop dream code
- How thingjs enables low threshold 3D visualization development
- Geoserver添加mongoDB数据源
- List interface three sub implementation classes
- Keng dad's "dedication blessing": red packet technology explosion in Alipay Spring Festival Gala
- Open source stealing malware mercurial found in the field for "educational purposes"
- 6-shining laser application of calayer
猜你喜欢

Keng dad's "dedication blessing": red packet technology explosion in Alipay Spring Festival Gala

6月《中国数据库行业分析报告》发布!智能风起,列存更生

Introduction to typescript and basic types of variable definitions

高通9x07两种启动模式

The fourth online workshop review

测试-- 自动化测试selenium(关于API)

636. Exclusive Time of Functions

Which is better, semrush or ahrefs? Which is more suitable for GoogleSEO keyword analysis

Summary of communication mode and detailed explanation of I2C drive

'教练,我想打篮球!' —— 给做系统的同学们准备的 AI 学习系列小册
随机推荐
驱动架构 & platform平台总线驱动模型
3. caller service call - dapr
Balls and cows of leetcode topic analysis
3. Caller 服务调用 - dapr
65. Valid Number
Flink错误--Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered “time“
Utilisation du cookie du module de demande de noeud
65. Valid Number
How to restore visualizations and dashboards after kibana rebuilds the index
[QNX Hypervisor 2.2用户手册]6.2 网络
7-palette-calayer and touch
Top 25 most popular articles on vivo Internet technology in 2021
The most commonly used 5-stream ETL mode
Android kotlin coroutines KTX extension
Map interface and its sub implementation classes
523. Continuous Subarray Sum
Leetcode topic analysis sort colors
Keng dad's "dedication blessing": red packet technology explosion in Alipay Spring Festival Gala
node request模塊cookie使用
usb peripheral 驱动 - configfs